Open Excel using Access macro
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
----------------------------------------------------------
HTH
"Andy" wrote:
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.
|