Can my book activate book2 on computer2?

adnakarivach

New Member
Joined
Nov 1, 2004
Messages
23
Hello, is it possible to have my active workbook open a second workbook in my computer number 2 (in the same network) with the MACROS ALREADY ACTIVE?) :confused:
I am trying to control computer usage and i have a workbook with a timer that I scavanged from old post, wich after a set time it would activate a sheet in computer #2 telling my kid is quitting time. :(
any comments or help?
i have the code for everything, except the link to open 2nd book with macros active.
thanks :pray:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
As far as I know, there is no way to bypass the macro question in code -- otherwise, it would be too easy for malicious code to run anywhere without intervention.
I think you're stuck with having to enable code manually as the workbook is opened.

Denis
 
Upvote 0
Depends what you mean by "another computer". If the file is in a shares folder / shared drive, you can switch directories and open the file. If not, it may still be possible but that's beyond my skills.

Denis
 
Upvote 0
ohhhhhh so if i leave it in a shared folder i can active it from anycomputer and activate the timer from there?
Thanks, i hadn´t thought of that.
 
Upvote 0
:wink: RUNNING MACROS THAT ARE LOCATED IN A DIFFERENT WORKBOOK ..... IS A SNAP !!!! :wink:

To run a macro that is located in another workbook, use Application.Run. The name of the workbook and the macro should be enclosed in double quotes. If the file name contains spaces, the file name must be enclosed in single quotes. Also, an exclamation point is needed between the workbook name and the macro name.

EXAMPLE:
Application.Run "'My Workbook.xls'!SomeRoutine"


If you need to run a function that is in another workbook, then you can use a statement like the following:
EXAMPLE:
RetValue = Application.Run("MyAddin.xla!MyFunction")


If the function has arguments, then you would use the following approach:

RetValue = Application.Run("MyAddin.xla!NeatFunction", 5)

The same approach would work with procedures that take arguments. :wink:
 
Upvote 0
i have a problem. :cry: :oops:
first, i got confused by the code that is kindly been given to me.
second, if i access the workbook on computer2 FROM computer1, it opens on computer 1 NOT computer 2.
is the code above going to fix that?
and if it is, doesn't it need to know the address of computer 2
i.e. //pc02/c:/?
thanks in advance for any suggestions.
:p
 
Upvote 0
If you're opening a remote file, it does open on the PC that made the call. Also, if the shared folder has a different drive letter from the place where you called it, you need to change directories to access the file. Example --
Code:
Sub CallAnother()
    Dim fPath As String
    
    ChDir "M:"
    fPath = "Folder1\Folder2\MyFile.xls"
    Application.Run (fPath & "!MyMacro")
    
End Sub
Hope that helps

Denis
 
Upvote 0
adnakarivach

PC's are not servers ... they are designed to run the file that is activated on the local CPU not on the remote one.
To accomplish what you want to do you must either ...
1. Look at the MS utility kit for a app that will run as a service waiting to be called
2. Run what you want to do thru the scheduler

Either way excel is not designed to do what you hoping it will do.

If you call a macro in another excel sheet it is going to run locally .
 
Upvote 0
There is a way you could control excel on another computer through excel VBA on a seperate computer, but it would involve either shared workbooks and or random access files through VBA.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top