D
dlevine54
have an Access database from which I create a CSV file. Now they want an
XLS spreadsheet also. Since I already have the CSV I want to use that to
create the spreadsheet but can't. I'm using Office 2003. My code is below.
Dim oExcel As Object
Dim oBook As Excel.Workbook
Dim oBooks As Excel.Workbooks
Dim oSheets As Excel.Sheets
Dim oSheet As Excel.Worksheet
' Open the excel spreedsheet
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add()
Set oBook = oExcel.Workbooks.OpenText(CSV_doc_name, StartRow:=3, _
DataType:=Excel.XlTextParsingType.xlDelimited, Comma:=True)
oBook.Close
Set oExcel = Nothing
I keep getting an 'Object is required' error on the OpenText line. Can
someone help me understand why?
XLS spreadsheet also. Since I already have the CSV I want to use that to
create the spreadsheet but can't. I'm using Office 2003. My code is below.
Dim oExcel As Object
Dim oBook As Excel.Workbook
Dim oBooks As Excel.Workbooks
Dim oSheets As Excel.Sheets
Dim oSheet As Excel.Worksheet
' Open the excel spreedsheet
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add()
Set oBook = oExcel.Workbooks.OpenText(CSV_doc_name, StartRow:=3, _
DataType:=Excel.XlTextParsingType.xlDelimited, Comma:=True)
oBook.Close
Set oExcel = Nothing
I keep getting an 'Object is required' error on the OpenText line. Can
someone help me understand why?