Posts by ascalese

    Re: Array values into a msgbox


    brymer,


    Let me offer you a little advise on how to get people to help you on message boards. Criticizing someone in your quest for help isn't going to make someone want to help you. You're opening line is combative. At the time I posted for assistance, the response from Bill gave me exactly what I needed to get over the hump on the code I was trying to develop. It is not his responsibility to tell me or any poster if I am following the proper rules for coding such as declaring variables. the declaration of variables is something that some very proficient coders never do because other languages do not support/require it. Even something as closely related as VBScript will allow you to declare variable but no the type.


    If you are having problems, I would suggest a more cooperative approach. All capitalized words is the equivalent of screaming. Professing your experience with VBA while also asserting that you cannot figure something out again does not inspire me (and I would guess others) to want to help you. The reason is that every time I have heard about how skilled and experienced someone is, they generally don't want to hear what you have to tell them.


    If you look at my first posting, I included the code that I had already attempted. It clearly showed that I gave it a fair effort. I asked for ideas on how to improve it and Bill responded. Finally, I thanked Bill for his contribution. Following basic forum etiquette will result in far more meaningful results and assistance.


    Re: Filecopy An Open Workbook


    Solved: I found this on how to use the API to copy. Works like a charm for anyone else that may need it.


    http://discussion.autodesk.com/thread.jspa?threadID=534407


    Code
    Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" _
    (ByVal lpExistingFileName As String, _
    ByVal lpNewFileName As String, _
    ByVal bFailIfExists As Long) As Long


    I am trying to copy an excel file from one server to another. I tried to use filecopy but since the workbook is open, it returns an error.


    I know, close the workbook. I wish it were that easy (unless I'm really dumb and unnecessarily complicating it). The excel doc that I am trying to copy has the code to perform the copy. I want it to copy only after other macros are executed. Any ideas on how I can get around this?

    Re: Call Private Sub From Another Sub


    Thank you, that helps. To continue on that path, how do calls to forms interact with this?


    Here's what I am trying to do. I have a workbook that has several macros. I want to control how a user executes them. For example, only be able to run them from a button. Any suggestions on other approaches?

    Re: Savechange:=false Does Not Stop Prompt


    Got it! It is another add-in that I have installed that is invoked automatically on workbook events like close and save. I added


    Code
    application.enableevents = false
    workbook("Test.xls").close savechange:=false
    application.enableevents = true


    and now it works....damn 3rd party add-in :)


    Thanks for the help!

    I have a workbook that uses function to check the Custom Defined Properties of the activeworkbook and compare it to the CDPs of another workbook. I open the 2nd workbook to retrieve the CDP and when I close I am prompted to save even though I have turned off alerts and tried both SaveChanges:=False, Saved = True.


    Any idea what the issue is? The function (and the sub that call it) are below:



    Re: Disable Save Button


    No can do, I need the functionality of the add-in. Even if I switch it off before save, it keeps it's meaty little hooks into the workbook until after the save giving me the same problem.

    Is there any way to disable the save functionality of excel - specifically Ctrl+S, Save button and Save, Save As (from the file menu)?


    I can't use the Workbook_BeforeSave event because as soon as excel makes a call to save (even if the call is cancelled in the event), one of the add-ins that I have installed tries to unprotect each sheet in the workbook. I am working with the vendor on a fix but until that is in place, I need to disable save and add a macro to save (the add-in doesn't get called when save happens via a macro - don't ask me, the vendor has "undocumented features" all over this add-in)


    Any ideas?

    Re: Event Macro Causes Sheet Protection Prompts


    Simon, I think you were onto something there. I added an unprotect routine before I can the other add-in's functions. Now once the macro completes and I try to save manually, I am being asked to unprotect. Do you think it's the same problem?

    I have a macro that is attached to the Worksheet_Change event. The first time I execute this macro, it runs without an error.


    One of the things it does throughout the course of the run is unprotect the worksheet, do what it needs to and then reprotects the sheet (using a password). On the second run, the sheet protection input box is shown and I am required to input the password before the code will execute.


    Any idea what may be causing this and how to correct it?


    fyi - The code that I have written uses an Add-in that pulls data from a database. As part of that retrieval, the other add-in protects the sheet without a password. Would that be causing my error?