ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Excel using Access macro (https://www.excelbanter.com/excel-programming/355324-open-excel-using-access-macro.html)

No Name

Open Excel using Access macro
 
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.



DaveO

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.




No Name

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

<Andy wrote in message ...
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.





All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com