AnsweredAssumed Answered

When writing a macro: choose referenced object libraries in the code?

Question asked by Tyler Hilgendorf on Aug 29, 2017
Latest reply on Aug 30, 2017 by Tyler Hilgendorf

I am writing a macro that references Microsoft Excel 14.0 Object Library. The problem is, some of our computers have an older version of excel, so they only have the 12.0 library. If I am on one of those computers and try to run or edit the macro, it either throws an error and I have to manually change the reference, or it completely crashes Solidworks, corrupts the macro, and I have to rebuild it by importing all the files.

 

Is it possible, at the beginning of my macro, to have a check in the actual code that looks to see which library is available, and use that one?

Outcomes