Are you using an unmodified macro example from the API Help or did you modify it? If you modified it lets see your code. Some other things you might try:
1. Create a macro that only tests the pack and go functionality, so it removed from other factors that might be involved if your code is part of a larger macro. Also, this way you can post it on the forums and it is easier for others to help you with.
2. Try running that same code on a different computer. If it works then there is obviously a conflict on your computer or a bad installation.
Dim swApp As SldWorks.SldWorks
Dim Document As ModelDoc2
Dim Errors As Long
Dim Warnings As Long
Dim FileName As String
Dim swPackandGo As PackAndGo
Dim SwModelDocExt As ModelDocExtension
FileName = "c:\temp\part-old.SLDPRT"
Set swApp = Application.SldWorks
Set Document = swApp.OpenDoc6(FileName, swDocPART, swOpenDocOptions_ReadOnly, "", Errors, Warnings)
Set SwModelDocExt = Document.Extension
Set swPackandGo = SwModelDocExt.GetPackAndGo <----fails right here
I'll have to try this on another computer and see if I get the same error. Thanks for the reply!
Btw, I wanted to test this with just a Part file to keep it simple. So I modified some things from the API vb example code to get it to work with a part file.
Works fine for me. I think it might be specific to your computer. I do know that the Pack and Go portion of SolidWorks can have errors associated with it. Can you create a pack and go manually, without using the API?
Hmm...very interesting. Yes, I can use the pack and go feature maually in Solidworks. I actually tried to use the Macro recorder first with the Pack and GO feaure to see if it'll record it, but it did not...
Let me try the VBA script on another computer and return with the results.
Great news, you were right. I tried the script on another computer and it works. I'll have to try reinstalling Solidworks on the broken machine. Thanks for you help Keith!