Is it possible to open and edit .swp file without SolidWorks, using an external program?
I don't think it will help any but the file format for the .swp files (like most SW files) is COM Structured Storage. There are a number of viewers available. Internally it is broken up by sections like "The VBA Project" but those sections are encoded in some non ascii format. If you want to create files from scratch, you can create SWB files (the older macro format) and SW can read and covert them. I have not worked with SWB format but I believe it is just the module (BAS) code.
you can export SW-macro to .bas, then edit it, let's say with Notepad++ for example. Then import .bas back with SW..
Retrieving data ...