Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
run macro from anoter Excel session
Hi,
I am trying to run a macro from another open workbook on another excel session. I have tried using Application.Run (PathToFile & "\" & NameOfFile & "!MacroName") but the it open a new workbook (read only) and also get stuck. Any idea, Thanks Dan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
run macro from anoter Excel session
Sub test2()
Dim PathToFile As String, NameOfFile As String Dim XLother As Application PathToFile = "C:\Temp" NameOfFile = "myFile.xls" On Error Resume Next Set XLother = GetObject(PathToFile & "\" & NameOfFile).Parent On Error GoTo 0 If XLother Is Nothing Then MsgBox NameOfFile & " not found" Else XLother.Run "myMacro" End If End Sub Regards, Peter T "Dan" wrote in message ... Hi, I am trying to run a macro from another open workbook on another excel session. I have tried using Application.Run (PathToFile & "\" & NameOfFile & "!MacroName") but the it open a new workbook (read only) and also get stuck. Any idea, Thanks Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run macro from onoter Excel session | Excel Programming | |||
Updating from one list to anoter | Excel Programming | |||
Macro to run RDP session | Excel Discussion (Misc queries) | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
Start a new session when a session is already opend | Excel Programming |