Running Macros

From: Steve (anonymous_at_discussions.microsoft.com)
Date: 09/20/04


Date: Mon, 20 Sep 2004 09:54:46 -0700

When I do open the file first using the workbooks.open
command I get a run-time error 9, Subscript out of Range
error when the workbooks(filename).activate command is
issued.

I know this probably is not as hard as it appears, but
none of the resources I have available provide a clear
example of what I need to do. I know my problem has to be
syntax, but MS Excel help and one other resource I have at
hand do not provide any real help!

Frustrated! Help!

Thanks!

Steve

>-----Original Message-----
>hi,
>is the other workbook open. if not then the macro will be
>unavailable.
>if is is open then try activing the workbook before you
>pass the parameter to it.
>
>workbooks(workbookname.xls).activate
>
>>-----Original Message-----
>>I am relatively new to VBA in Excel and am having
>trouble.
>>I am trying to call a macro in another workbook and pass
>a
>>parameter to that macro. Help does not provide a
>>reasonable explanation or Example to follow. I would
>>appreciate any help I can get in solving this problem!
>>
>>TIA
>>
>>Steve
>>.
>>
>.
>



Relevant Pages

  • Re: Macro for special Insert comment text
    ... Run-time error "5" ... I have still problems with the macro. ... VBAProject >Microsoft Excel Objects>Modules>Module1 ... I cannot replicate that error on opening the workbook. ...
    (microsoft.public.excel.programming)
  • Re: Code created in a Macro not working for a Command Button
    ... the run-time error. ... As I mentioned previously, I created the macro, edited it with a few ... Thanks again Ron. ... > Ok...I created a macro to give me a head start with a command button. ...
    (microsoft.public.excel.programming)
  • Re: Macro for special Insert comment text
    ... Run-time error "5" ... I have still problems with the macro. ... VBAProject >Microsoft Excel Objects>Modules>Module1 ... I cannot replicate that error on opening the workbook. ...
    (microsoft.public.excel.programming)
  • Re: How to assign a macro
    ... I dont want the form to do anything, But i want 2 command buttons on it, one ... >> I have a workbook with 30-40 different sheets, i have a command button on ... >> each sheet that start a macro called Sub Producedwatersystem. ...
    (microsoft.public.excel.misc)
  • RE: Run Excel Macro from Command Line
    ... file from that workbook; even have it write the module to your new file. ... > Is there a way to run an Excel macro from a command line. ...
    (microsoft.public.excel.programming)