So when you run the macro with the UnitFixer Sub, you are getting "method not found" on the call to SetUserPreferenceInteger() but you are having no problems with the recorded macro that makes the exact same call?
If you look in references, do you see any differences between which libraries the recorded macro uses versus the one that you've written?
You have a problem in the code you didn't post. Try to create a complete example that exhibits the bad behavior and post it here. For example, this code works with no problems:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Sub test(swModel As ModelDoc2)
boolstatus = swModel.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsMassPropDecimalPlaces, 0, 3)
So, how is your code different from the above?
Thank you for your reply, it led me to the right answer. I thought I was doing as you described before I posted, commenting everything that I thought was relevant out. But I missed the below lines. The macro I have is a Frankenstein out of other macros and the below line was included. Not being well versed in VBA or programming, I am not even sure what it does. Got to do more research on my VBA. Commenting out the below let it run.
Public Enum swUserPreferenceIntegerValue_e
swAutoSaveInterval = 3