AnsweredAssumed Answered

Running macros on exported parts list

Question asked by Peter Ham on Sep 18, 2019

When using the "Open as a CSV file" button on the BOM tab of PDM, the following happens:

  • A file named tmp#.tmp (where # is an integer with unknown limit) is created in %AppData%/Local/Temp
  • A new instance of Excel opens, and loads tmp#.tmp


I have a macro workbook (PDMMacros.xlsb) that lives in %AppData%/Roaming/Microsoft/XLStart, and should be loaded every time Excel opens. The macros are then used for various clean-up and preparation duties, and the desired workflow is for this clean-up to happen without any user interaction.


My issue is that when the .tmp file is opened automatically from the "Open as a CSV" button, that instance of excel doesn't load my .xlsb file, and therefore my macros aren't available.

Manually opening the .tmp file does loads the .xlsb, as does File > Open > PDMMacros.xlsb.


I'm looking for a way to ensure excel loads my xlsb with the .tmp file, or any other way to automatically run macros on it.


Any advice or suggestions?