in the upper part of the code, when you created the variable swApp, change
Dim swApp As SldWorks.SldWorks
Public swApp As SldWorks.SldWorks
It's works now.
Also use this line
Set swApp = Application.SldWorks
Set swApp = CreateObject("SldWorks.Application")
Also you've used these lines at many places which I believe should to be changed to just one place only.
Set swApp = CreateObject("SldWorks.Application") or Set swApp = Application.SldWorks
I'll do that. Thank you.
I think you got all the response here; however, can you click tools, references in the IDE to make sure the obj. lib. all correct