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:
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
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
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
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
 

adnakarivach

New Member
Joined
Nov 1, 2004
Messages
23

ADVERTISEMENT

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.
 

Nimrod

MrExcel MVP
Joined
Apr 29, 2002
Messages
6,259
: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:
 

adnakarivach

New Member
Joined
Nov 1, 2004
Messages
23

ADVERTISEMENT

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
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
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
 

Nimrod

MrExcel MVP
Joined
Apr 29, 2002
Messages
6,259
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 .
 

RoyHarper

New Member
Joined
Feb 18, 2005
Messages
32
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,519
Messages
5,596,634
Members
414,082
Latest member
sasmita

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
Top