Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run macro from onoter Excel session Dan Excel Programming 3 October 20th 09 07:06 AM
Updating from one list to anoter [email protected] Excel Programming 1 March 15th 08 09:43 PM
Macro to run RDP session alistew Excel Discussion (Misc queries) 0 February 22nd 08 11:27 AM
Startup and template locations in Citrix TS session and local session John Nurick Setting up and Configuration of Excel 2 September 21st 06 10:42 PM
Start a new session when a session is already opend MD Excel Programming 1 December 17th 05 05:47 PM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"