Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Run a macro in a workbook through VB6

What is the proper syntax to run a macro which has
parameters in a specified workbook?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Run a macro in a workbook through VB6

hi,
If the macro is in the current WB then
toolsMacrosmacrorun should do it. you will be prompted
of the perameters.
If the macro is to be run on another WB then code must be
add to open the other workbook.
ChDir "C:\dir1"
Workbooks.Open Filename:="C:\Dir1\file2.xls"
or if open to activate the file.
Windows("file2.xls").Activate

-----Original Message-----
What is the proper syntax to run a macro which has
parameters in a specified workbook?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Run a macro in a workbook through VB6

Actually I need to run a macro in a specific workbook
throufh a VB.exe I wrote. The excel workbook is never
visible. How do I run a function that takes parameters in
a workbook through VB6?
-----Original Message-----
hi,
If the macro is in the current WB then
toolsMacrosmacrorun should do it. you will be prompted
of the perameters.
If the macro is to be run on another WB then code must be
add to open the other workbook.
ChDir "C:\dir1"
Workbooks.Open Filename:="C:\Dir1\file2.xls"
or if open to activate the file.
Windows("file2.xls").Activate

-----Original Message-----
What is the proper syntax to run a macro which has
parameters in a specified workbook?
.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Run a macro in a workbook through VB6

Hi Eric,

What is the proper syntax to run a macro which has
parameters in a specified workbook?


From VB:

xlApp.Run "WorkbookName.xls!RoutineName", arg1, arg2

where xlApp is a variable referencing the Excel Application object.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Run a macro in a workbook through VB6

Check the Application object's Run method.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
What is the proper syntax to run a macro which has
parameters in a specified workbook?

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
saving macro from workbook to Personal Macro Workbook KrispyData Excel Discussion (Misc queries) 1 March 25th 10 05:52 PM
Combine worksheets in multiple workbook in one workbook with a macro Sam Commar Excel Discussion (Misc queries) 2 April 2nd 09 01:09 PM
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please harry Excel Programming 5 December 20th 03 03:26 AM


All times are GMT +1. The time now is 10:28 AM.

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"