![]() |
|
#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
|
|
#3
|
|||
|
|||
|
Bird_FAT, I being a newbie, where are the scales ?
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Help! for using an appropriate function/Macro in Excel
|
pawan2paw | Excel | 1 | 06-04-2009 12:28 PM |
Should I uses Access or Excel?
|
tinkertron | Office | 5 | 03-29-2009 08:30 PM |
| Excel or Access ? | inferno | Excel | 0 | 10-03-2008 03:42 AM |
| Phone call through TAPI driver | drdebate | Outlook | 0 | 04-09-2007 01:46 PM |
Access 2003 query with wildcards into Word 2003 mail merge
|
Poingdexter | Office | 1 | 10-30-2005 06:17 PM |