This is an API example from the SW API Help
I am getting the following error.
I have the exposed type libraries for add-in selected (references)
Am I missing something? Please help.
The same macro is available in SW2013 API help also. Further PropertyManagerPage2Handler5 has been superseded by PropertyManagerPage2Handler9 in 2013. So this macro should work fine in 2013.
Disabling MSACAL fixed the error. JOHN GEORGE attached is the fixed macro. But I'm not sure how to use it as it is just an example.
You need to add MSCAL.OCX library to the macro. Check these two pages for further info and a possible fix.
Missing Calendar Control
I added that library and selected Calendar Control 11.0 in reference
Now I am getting different error
I've not much idea but I think it should be PropertyManagerPage2Handler5 and not PropertyManagerPage2Handler
you can easily correct this error, by choosing PropertyManagerPage2Handler on left side and then find and click all methods on right side, which are not bold. Then they wil be added automatically.
Thanks for the tip Ivana but how to resolve the error in the updated macro which I and John has posted above. Thanks for the insight and help.
I don't know, I don't have SolidWorks 2015 so I can't run this code, because PropertyManagerPage2Handler5 doesn't exists in 2013. What I woul'd try, is disablen calendar ocx. I can imagine, because it is an old example that ocx is 32 bits and is not working with 64 bits SW.
This macro doesn't do anything to the part level, just shows different controls in the propertymanager tab.
Trying to see if this can be added to other macros (part of a learning process..)
Anyway, thanks for fixing the code without calendar control.
Thanks for your insight and help!
Change to PropertyManagerPage2Handler5 gives more errors
I doubt, might be something else..
The reason I said to use PropertyManagerPage2Handler5 becuase same has been used in the other macro UAP which was fixed by Tapani. Could you upload updated macro to check further.
Here is the updated macro and the error
Modified the code again and now different error (below)
Could you also attach the MSCAL.OCX file too. My antivirus is not allowing it to download.
Also when you see this error? I mean there is nothing related to this error in the macro.
The latest error is the run-time error as shown above
You would find many similar errors while running this macro as this seems to be not complete.
For instance for the current error add these lines in the PropMgrHdlr at the end.
Private Sub PropertyManagerPage2Handler5_OnSelectionboxCalloutCreated(ByVal Id As Long)End Sub
Private Sub PropertyManagerPage2Handler5_OnSelectionboxCalloutCreated(ByVal Id As Long)
Once you do that you would get another error. Which you would have to search in the API help file and add that again. Keep doing it untill all required ones have been added.
Attached is updated macro that runs but I could under stand this issue
I have gone thru all these errors and fixed most of these by looking at the other example files
Try this updated one (sorry, it's same name as before)
That is the same error I'm stuck at and could not fix due to my limited knowledge with API.
But if you quote or remove that line then no error is there. Does this means macro can work?
Retrieving data ...