Could you post the full macro as it is hard to figure out the issue by just looking at two lines of code?
Make it a habit to read the Remarks section of the help. Particularly when you run up against something like this. Here's an excerpt for your convenience:
ISldWorks::OpenDoc6 does not activate and display the document if the file is already open in memory in an assembly or drawing. However, ISldWorks::OpenDoc6 should return a valid IModelDoc2 pointer that is usable with functions that do not require a document to be displayed. If you want, ISldWorks::ActivateDoc2 or ISldWorks::IActivateDoc3 will activate and display the document. Because calling ISldWorks::OpenDoc6 does not activate nor display the file, calling the ISldWorks::ActiveDoc or ISldWorks::IActiveDoc2 property will not return a pointer to this document.
Thanks for the help. I did receive a response from solidworks and it was
OpenDoc6 does not take 0 as an argument for options.
Please use 1 (swOpenDocOptions_Silent)
I had 0 in the options area, this is because when you record a macro it puts a zero in that place when opening a file.
Hopefully this helps someone else and i will try using ActiveDoc2 or 3 and see what results i get.
"C://..." path separator is backslash \\