I have a which shows today sales in a simple chart (pivot table) which I want to export to excell and send by email. after reading many posts here I have created a vbscript which open the QVW reload it, make the export and then execute a macro that send the email.
everything worked fine the first few times I have tested it but today when ever I run the vbscript I am getting the following error:
I am assuming that the error now refers to MyDoc rather than ActiveDocument.
It seems that the OpenDoc command is not successfully opening the QV document. This could be due to one of the following (which you may have already checked, but in case you havent):
the path is incorrect. Verify that the document exists at that location, and that the script is running on the same machine as the D: drive.
the document has section access, and you are not running the script in the correct user context (NTNAME section access), or it requires a username/password in the second and third parameters (not an empty string).
the document is unavailable due to active directory / NT security settings
lastly, and I hope not the case, the document is corrupted.
Something else I haven't thought of.
Can you open the document manually? Is the script running under your username?
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein