View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
gocush[_29_] gocush[_29_] is offline
external usenet poster
 
Posts: 252
Default Run code remotely

Workbook1 has a clickevent on it. If I press the click event, the code
sends a little bird down the hall and into the server room of our company.
In that room, the bird opens the excel file Workbook2, and runs a macro
called "Main".

Let's see if I can re-phase this in programming terms:
Workbook1 has a clickevent on it.In Workbook1 I have a macro or vba
procedure which is triggered by a Command button on Sheet1.

If I press the click event, the code
sends a little bird down the hall and into the server room of our
company...
When I click the Command Button I want the procedure to Open Workbook2
on the network server and run a procedure in Workbook2, called "Main"

Yes this is quite possible with something like:

Workbooks.Open Filename:= _
"H:\Documents and Settings\UserName\MyFolder\Workbook2.xls"
'adjust the path you you network
'then
'I think this is the code line you are looking for
Application.Run Workbook2 & "!Main"




"Steph" wrote:

Hello everyone. I have asked this question a few other times, but I am
extremely confident that I have done an extremely poor job of explaining
it!! So one more time, in really simple theoretical terms:

Workbook1 has a clickevent on it. If I press the click event, the code
sends a little bird down the hall and into the server room of our company.
In that room, the bird opens the excel file Workbook2, and runs a macro
called "Main".

Is this possible (other than buying an extremely intelligent bird)?? Thank
you!!

-Steph