Open a Macro Enabled Worksheet from Access

  • Thread starter Thread starter Tim
  • Start date Start date
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
 
Hello, It might just be the file extension. you have yours set to xlsx but a
macro enabled spreadsheet has the extension of xlsm.
 
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.
 
Back
Top