![]() |
|
|
#1
|
|||
|
|||
|
How do I call/execute an Excel macro from Access 2003. TIA
|
|
#2
|
||||
|
||||
|
Add a command button and use the following code as a starter.
(in this example, I have called the Command Button - 'MyCommandButton' - change the sections of this code to fit with the name of your button [or rename your button]) Code:
Private Sub MyCommandButton_Click()
On Error GoTo Err_MyCommandButton_Click
Dim xlsApp As Excel.Application
Dim xlswkb As Excel.Workbook
Set xlsApp = CreateObject("Excel.Application")
Set xlswkb = GetObject("*FULL_PATH_TO_FILE*")
xlsApp.Application.Run "*FILE_NAME*!*MACRO_NAME*"
xlsApp.Quit
Exit_MyCommandButton_Click:
Exit Sub
Err_MyCommandButton_Click:
MsgBox Err.Description
Resume Exit_MyCommandButton_Click
End Sub
Still some work in there for you, but This should give you the start you need
__________________
Bird If my post has helped, please add to my reputation in return - Thanks! Windows XP > Office 2003 Windows 7 > Office 2007 MASTER+ |
|
#3
|
|||
|
|||
|
Bird_FAT, I being a newbie, where are the scales ?
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! for using an appropriate function/Macro in Excel | pawan2paw | Excel | 1 | 06-04-2009 04:28 PM |
| Should I uses Access or Excel? | tinkertron | Office | 5 | 03-30-2009 12:30 AM |
| Excel or Access ? | inferno | Excel | 1 | 12-06-2008 11:43 AM |
| Phone call through TAPI driver | drdebate | Outlook | 0 | 04-09-2007 05:46 PM |
| Access 2003 query with wildcards into Word 2003 mail merge | Poingdexter | Office | 1 | 10-30-2005 09:17 PM |