J
John J.
From Access I'm trying to convert several *.htm excel files into 'real'
excel files.
Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim strFile As String
Set appExcel = New Excel.Application
strFile = "D:\My documents\Test.htm"
Set wkb = appExcel.Workbooks.Open(strFile)
appExcel.Visible = True 'Do something with worksheet
ActiveWorkbook.SaveAs Filename:="D:\My documents\Test.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Set wkb = Nothing
Set appExcel = Nothing
The first time this code runs fine but the second time it gives the
following error:
"Object variable or block variable With is not set."
Strange thing is that the 3rd time it runs OK again, 4th time same error,
etc.
Can someone explain what's going on here?
Thank you,
John
excel files.
Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim strFile As String
Set appExcel = New Excel.Application
strFile = "D:\My documents\Test.htm"
Set wkb = appExcel.Workbooks.Open(strFile)
appExcel.Visible = True 'Do something with worksheet
ActiveWorkbook.SaveAs Filename:="D:\My documents\Test.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Set wkb = Nothing
Set appExcel = Nothing
The first time this code runs fine but the second time it gives the
following error:
"Object variable or block variable With is not set."
Strange thing is that the 3rd time it runs OK again, 4th time same error,
etc.
Can someone explain what's going on here?
Thank you,
John