T
troy_lee
I am writing code in Access. I want to initialize Excel. I found some
code that looked good and massaged it for my purposes. I am getting a
failure "Method or data member not found" at the
objXLApp.Workbooks.Open (strDocPath) line. Can someone please tell me
what I am doing wrong? Workbooks is clearly a member of the Excel
application class.
Thanks in advance for the help.
Private Sub cmdTest_Click()
Dim objXLApp As Application
Dim strDocPath As String
'Full path and name of template
Dim strPath As String
'Full path and name to save file as
strDocPath = "C:\Scorecard\Scorecard Template.xls"
strPath = "C:\Scorecard\Files\"
Set objXLApp = CreateObject("Excel.Application")
objXLApp.Workbooks.Open (strDocPath)
objXLApp.ActiveWorkbook.SaveAs (strPath)
End Sub
code that looked good and massaged it for my purposes. I am getting a
failure "Method or data member not found" at the
objXLApp.Workbooks.Open (strDocPath) line. Can someone please tell me
what I am doing wrong? Workbooks is clearly a member of the Excel
application class.
Thanks in advance for the help.
Private Sub cmdTest_Click()
Dim objXLApp As Application
Dim strDocPath As String
'Full path and name of template
Dim strPath As String
'Full path and name to save file as
strDocPath = "C:\Scorecard\Scorecard Template.xls"
strPath = "C:\Scorecard\Files\"
Set objXLApp = CreateObject("Excel.Application")
objXLApp.Workbooks.Open (strDocPath)
objXLApp.ActiveWorkbook.SaveAs (strPath)
End Sub