expor to excel and call macro from other excel

eatraas

Registered User.
Local time
Today, 15:00
Joined
Jan 23, 2009
Messages
96
Hi,

i want to export a table to excel , open this file and execute a macro from another file.

the code i have now is :

Code:
DoCmd.OpenTable "Overzichtaanwezigheid", acViewNormal
 DoCmd.RunCommand acCmdExportExcel
 DoCmd.Close acTable, "Overzichtaanwezigheid"
 Dim XL As Object
 Set XL = CreateObject("Excel.Application")
 XL.Workbooks.Open ("C:\Users\Erwin\Documents\Overzichtaanwezigheid.xlsx")
 XL.Visible = True
 XL.Run "d:\test.xlsm!Macro3"

Opening the excel file goes ok, running the macro however not.

How can this be done?

Thanks in advance

Erwin
 
Hi eatraas,

Why don't you run the second macro from Access just as you have run this first one?

Is there a reason you need to run the code from the Excel file?

My suggestion would be to Call the second Macro in your code from the first one but I haven't tried this.

Hth.
 

Users who are viewing this thread

Back
Top Bottom