Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: C_Haines_ENG

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

EESignature

(Not an Autodesk Employee)