I have written a complex macro in excel and now have to distribute it to
co-workers. However, I want to create an executable file which will run the
macro directly (will open the userform in my macro).
Is there any chance of doing so?
Thanks in advance
Regards,
Pawan
Next create a BAT file to open the workbook and run the Bat.
Here is a sample of the bat file
"C:\Program Files\Microsoft Office\Office10\excel.exe" c:\temp\book1.xls
But I did not get the example given by you. It is exe file and it opens new
workbook. How can I use this to open the workbook that I wish?
Regards,
prm
Steve Yandl
"Pawan" <Pa...@discussions.microsoft.com> wrote in message
news:76B159FE-49F7-41F5...@microsoft.com...
Set XL=CreateObject("Excel.Application")
XL.Visible=True
XL.Workbooks.Open "C:\A.xls"
XL.Run "A.xls!TheMacro"
Change "C:\A.xls" to the appropriate file name. Change
"A.xls!!TheMacro" to the workbook name and macro name.
Save the file as a vbs file, e.g., RunIt.vbs rather than a txt file.
Then, all the user needs to do is double click the vbs file and Excel
will start, open C:\A.xls and execute TheMacro.
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)