Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2009, 01:49 PM
KramerJ KramerJ is offline How do I call/execute an Excel macro from Access 2003 Windows XP How do I call/execute an Excel macro from Access 2003 Office 2003
Novice
How do I call/execute an Excel macro from Access 2003
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 5
KramerJ is on a distinguished road
Default How do I call/execute an Excel macro from Access 2003


How do I call/execute an Excel macro from Access 2003. TIA
Reply With Quote
  #2  
Old 05-07-2009, 11:51 PM
Bird_FAT's Avatar
Bird_FAT Bird_FAT is offline How do I call/execute an Excel macro from Access 2003 How do I call/execute an Excel macro from Access 2003 Office 2007
Expert
 
Join Date: Apr 2009
Location: South East
Posts: 271
Bird_FAT is on a distinguished road
Default

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
You will, of course, need to add more code in there to do whatever else you need to do - view/print report/query, etc.

Still some work in there for you, but This should give you the start you need
Reply With Quote
  #3  
Old 05-11-2009, 11:33 AM
KramerJ KramerJ is offline How do I call/execute an Excel macro from Access 2003 Windows XP How do I call/execute an Excel macro from Access 2003 Office 2003
Novice
How do I call/execute an Excel macro from Access 2003
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 5
KramerJ is on a distinguished road
Default Excel Macro from MS Access

Bird_FAT, I being a newbie, where are the scales ?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I call/execute an Excel macro from Access 2003 Help! for using an appropriate function/Macro in Excel pawan2paw Excel 1 06-04-2009 12:28 PM
How do I call/execute an Excel macro from Access 2003 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
How do I call/execute an Excel macro from Access 2003 Access 2003 query with wildcards into Word 2003 mail merge Poingdexter Office 1 10-30-2005 06:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft