11-07-2023
06:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-07-2023
06:57 AM
Hi @C_Haines_ENG. When using CreateObject, you need to 'dispose of' any variables that got assigned something belonging to that 'created object', to truly remove all ties to it. In this case, the 'excelWorkbook' variable is still holding on to a reference of the opened Workbook, even after you disposed of the 'excelApp' variable. Before disposing of the 'excelApp' variable, dispose of any other variables created for stuff related to it, then dispose of the excelApp variable. What is you overall plan here...create a new Excel file, then what, then later try to save and close it again, but without holding on to the original variables for those objects? Why?
Wesley Crihfield
(Not an Autodesk Employee)