10-24-2020
02:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-24-2020
02:52 PM
Create a Excel file using VBA Inventor 2021+Excel2016 not works
Please help
After updating from Inventor 2018 to Inventor 2021,
I can't create an excel file !
Inventor 2018 + Excel 2007 32-bit , code works
Inventor 2021+ Excel 2007 32-bit , code works
After updating to Inventor 2021
Inventor 2021+ Excel 2007 32-bit , code works
Inventor 2021+ Excel 2016 32-bit , code does not works !
Thank you
Private Sub Conect_To_Excel()
''Dim oExcel As Excel.Application
Dim oExcel As Object
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
'Create new workbook
Call oExcel.Workbooks.Add
Dim oWorkbook As Object ''Workbook
Set oWorkbook = oExcel.Workbooks.Item(1)
Dim oWorkSheet As WorkSheet
Set oWorkSheet = oWorkbook.Sheets.Item(1)
oWorkSheet.Cells(1, 1).Value = "writing works"
oWorkbook.SaveAs ("E:\test.xls") 'Save excel
oExcel.Quit
Set oWorkSheet = Nothing
Set oWorkbook = Nothing
Set oExcel = Nothing
End Sub