Open a Macro Enabled Worksheet from Access

T

Tim

Hey guys,
I had code that worked perfectly to open an Excel 2007 workbook until I put
code in it and then I was forced to save it as a Macro Enabled Worksheet and
now it doesn't open from Access. I have no idea what I need to do to the code
now - the Excel filename didn't change.
Any help please??

Private Sub Command32_Click()
On Error GoTo Err_Command32_Click

Dim appExcel As Object
Set appExcel = CreateObject("Excel.Application")
appExcel.Application.Workbooks.Open ("C:\Temp\RDP Failover Report.xlsx")
appExcel.Visible = True
Set oApp = Nothing


Exit_Command32_Click:
Exit Sub

Err_Command32_Click:
MsgBox Err.Description
Resume Exit_Command32_Click

End Sub
 
K

Kevin Smith

Hello, It might just be the file extension. you have yours set to xlsx but a
macro enabled spreadsheet has the extension of xlsm.
 
T

Tim

aaaaaand that's it brother!! Thank you!

Kevin Smith said:
Hello, It might just be the file extension. you have yours set to xlsx but a
macro enabled spreadsheet has the extension of xlsm.
 

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