It is not Dot Application. Application is the top of the OM, so it cannot be
dot qualified.
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"dim" <(E-Mail Removed)> wrote in message
news:781D23AD-B004-40E3-A061-(E-Mail Removed)...
> Thankyou very much,
>
> That helps but I think I didn't explain enough. I'm having trouble with
> specifying which Macro to run also. I've been trying variations of IF THEN
> ELSEIF as below but I keep getting errors!
>
> Macro1 in Book1 should decided whether to run Macro1/2/3etc in Book2
> dependant upon the value of a cell (Cell A1 in the example below) in
> Book1.
>
> I've tried putting variations of this into the code after the workbook
> opening code but it isn't working:
>
> If .Value(1,1) = 1 .Then .Application.Run "Macro1"
> Elseif .Value(1,1) = 2 .Then .Application.Run "Macro2"
> Elseif etc etc
>
> Where am I going wrong?
>
> :-(
>
> "Dave Peterson" wrote:
>
>> Typo alert:
>> Set WB = Workbooks.Open "Book2.xls"
>> should be:
>> Set WB = Workbooks.Open("Book2.xls")
>>
>>
>>
>>
>> Bob Phillips wrote:
>> >
>> > Set WB = Workbooks.Open "Book2.xls"
>> > Application.Run "'Book2.xls'!Macro1"
>> >
>> > --
>> > ---
>> > HTH
>> >
>> > Bob
>> >
>> > (there's no email, no snail mail, but somewhere should be gmail in my
>> > addy)
>> >
>> > "dim" <(E-Mail Removed)> wrote in message
>> > news:BC1C6F7B-231E-4608-9616-(E-Mail Removed)...
>> > > Hi folks,
>> > >
>> > > I have two workbooks - Book1 and Book2.
>> > >
>> > > In Book1 I have Macro1,
>> > >
>> > > In Book2 I also have a Macro1 (Or I can name it differently if
>> > > necessary)
>> > > and also Macro2 and Macro3 and Macro4 and....etc etc
>> > >
>> > > I want Macro1 in Book1 to open Book2 and then after opening to
>> > > automatically
>> > > execute Book2's Macro1 ?
>> > >
>> > > Sometimes I might want it to execute a different one of the Macros in
>> > > Book2
>> > > automatically after opening so I can't just include it as part of an
>> > > auto-open...I think...
>> > >
>> > > Please Help!!!....this is a very substantial stumbling block for my
>> > > current
>> > > file if I can't get over it.... :-(
>> > >
>> > >
>>
>> --
>>
>> Dave Peterson
>>
|