PDA

View Full Version : Add-in uninstalls after running on a CSV file



cplindem
06-16-2014, 10:53 AM
I have written a macro that is designed to apply a long series of formatting changes to the active workbook. It then saves the active workbook as a new file with the .xlsx extension. I saved the macro as an add-in. The problem is that the macro sometimes uninstalls itself.

My users will be using this add-in on CSV files. Note that I am well aware that you cannot save VBA code within a CSV file. I am not trying to do this. I simply have the macro (in the add-in) apply formatting changes to the active workbook, which happens to be a CSV file. This issue does seem to be caused by CSV files though.

For context, the issue seems to occur when a CSV file is double-clicked, which starts Excel. The macro is run. Then Excel is closed. The next time Excel is opened, the macro is no longer available and needs to be re-installed.

Does anyone know why this might be happening? Or if there is a way around it?

ranman256
06-16-2014, 01:45 PM
Is the add-in ...manually added to Excel before all this csv operation?

cplindem
06-16-2014, 02:23 PM
Technically the add-in can be added to Excel at any time. Maybe some users are adding it with a CSV file open and some are adding it prior to.

Are you suggesting that it should be added prior to opening a CSV file, and that could be making a difference?