I have an xlam (excel add-in macro) file that has a hidden worksheet in it. If the user does something to change the values within that worksheet, I have to save the addinfile so that it is available in the future i believe.
In order to save the xlam, i have the following function:
In the SaveAs call above, it creates these temporary files that are left behind in the directory where the file is being saved.
Does anyone know why that is being created and not cleaned up?
Also this saving step takes about 30 seconds. Is that expected?
In order to save the xlam, i have the following function:
VBA Code:
Public Sub SaveAddIn()
Dim strFileName As String
On Error Resume Next
strFileName = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1)) 'Get the name part without the rest so it can be saved...
ThisWorkbook.IsAddin = True 'There are scenarios that has the worksheet visible for editing, so i assert it back to being an addin and re-hide the worksheet
ThisWorkbook.SaveAs fileName:=ThisWorkbook.Path & "\" & strFileName & ".xlam", FileFormat:=xlOpenXMLAddIn 'THIS IS WHERE THE FILE IS SAVED AND THE TEMP FILE IS LEFT BEHIND. I am letting each user decide where to leave it, NOT in the default MS location for addins...
End Sub
In the SaveAs call above, it creates these temporary files that are left behind in the directory where the file is being saved.
Does anyone know why that is being created and not cleaned up?
Also this saving step takes about 30 seconds. Is that expected?