I don't think you'll be able to repurpose the SWTaskAddin to run tasks that don't open SolidWorks. I believe it is programmed to open SW and run the macros contained against the file, so success or failure is determined by SolidWorks. You can write your own task add-in and use it instead though, there's a section in the programmers reference guide about it:
That's just what I think needs to happen, I've never really tried myself.
try setting the SWApp.Visible=true in your Macro. You using Dispatch for this PDF creation?
I think I remember this was my issue last year.
I think you are spot on.
After further investigation, I found that by taking the default Advanced Script for PDF conversion (part of the SWTaskAddin), then incrementally removing sections of the code and running the task until the task returned an error, I found that if the Advanced Script does not make a call to:
Success = swExtension.SaveAs(...)
then apparently the SWTaskAddin detects this and marks the task as FAILED, regardless of the successful completion of the script.
I was hoping to repurpose the SWTaskAddIn to avoid the effort of writing my own TaskAddin. So I guess I will just have to make sure the SW method is called....
Thanks for pointing me in the right direction.