Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Macro Button in Excel

Status
Not open for further replies.

Adams

Technical User
Mar 10, 2001
44
US
I have an Excel workbook that contains Macro's(Macro Workbook). I would like to run these macro's from a button in another workbook (DataWorkbook). Is it possible to create a button in the DataWorkbook that would call the Macro's in the Macro Workbook? (I do have both workbooks open)

Thank You
Karen
 
Sorry to bother you.......I thought these forums were there for questions. I have read some of your other replies to people and you are not a very nice person................and the answer to your question "Yes" I have a F1. Next time I will think twice before posting any questions on this site.
 
Hello

You could try setting a macro to run a macro with the path in which should work . Sorry Im quite new myself but something like

Sub runmac

notsurewhichobject.Run(path here)

end sub

Youll need the VBA help for the prefix to the dot. I have done it but my examples at work and Im on hols for a while.

Try searching on running a macro in this forum Im sure youd find what I cant remember there.

Hope this helps a bit

Cheers

Neil
 
I wrote a sub in one workbook that displays a "Hello World" MsgBox. Here is how I call it from a command button in a different workbook:
Code:
Private Sub CommandButton1_Click()
Application.Run "Book1!HelloWorld"
End Sub
FWIW, I forgot the syntax, too. But it was a simple matter to record a macro while I was opening the Tools...Macro...Macros menu item in the other workbook to run the HelloWorld macro.
 
Private Sub CommandButton1_Click()
Application.Run "Book1!HelloWorld"
End Sub

this code works for another macro in excel, does anyone know how to run a macro in another program from excel? the specific program is autodesk inventor (drafting) but even a push in the right direction from another program would be much appreciated,
thanks much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top