Open Excel using Access macro

G

Guest

Hi
I just need to know how to open Excel from within Access. I don't need to
open a file - as my Auto-Open macro does that - and it quits Excel too.
An overnight scheduled task in Access creates an unformatted sheet, which I
would like my Auto_Open macro to format and I'd just like Access to
initiate the opening of Excel.
Thanks.
 
G

Guest

Here's something I use...

-----------------------------------------

Function fctFormatData(strMacro As String)

' Once the data is Output this fornmats the data. Personal.xls is used to
hold all external macros.

Dim xlsWorkbook As Excel.Workbook

DoCmd.SetWarnings False

Set xlsWorkbook = GetObject("c:\Book1.xls", "Excel.Sheet")
xlsWorkbook.Application.Visible = True
xlsWorkbook.Application.Run "PERSONAL.xls!" & strMacro, cstSite

End Function
 
G

Guest

Please ignore this post! I meant to post it on Access Programming - which is
what I'll do now!
Cheers.
Andy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top