I have a script which compiles perfectly ok BUT only runs succesfully sometimes. What is happening is that as a call to ExportAsHTML is made, the script causes a Dr Watson error. This, as I said, is not happening everytime the script is run so can’t directly be anything to do with the code per se.
The main part of the script runs fine EVERY TIME provided the report is already open and I don’t try to open or close the report in the script ie.
Sub Main
Dim myDoc as BODocument
Set myDoc = Application.Documents.Open(“myfilename”)
…
start main bit of script (this bit always works -
provided the opening and closing of doc not in code)
Call activereport.exportashtml(filename,parameters,) end main bit of script
…
myDoc.close
End Sub
I have tried different locations for the script before running it, removed the SBX file so that the script creates a new compiled file each time etc but nothing seems to make much difference.
Could it be something to do with either needing a DoEvents or setting an object back to Nothing?
"I have a script which compiles perfectly ok BUT only runs succesfully
sometimes. What is happening is that as a call to ExportAsHTML is made, the script causes a Dr Watson error. This, as I said, is not happening everytime the script is run so can’t directly be anything to do with the code per se."
Jonathan,
What version of BOI are you running? I am seeing the exact same thing from Doc Agent (4.1.3) when it tries to generate html. It only happens sometimes. I actually have version 4.1.1 running on one server and 4.1.3 on another. The problem has never occurred with the 4.1.1 version. Unless someone has an answer or suggestion, I am going back to 4.1.1 on both machines.
What version of BOI are you running? I am seeing the exact
same thing from
Doc Agent (4.1.3) when it tries to generate html.
4.1.2.
Please see following which makes the problem even stranger
Sent: 03 September 1998 12:22
Johan,
Thanks - it’s information worth knowing.
Anyway, I have tried all of your suggestions and the error is still occuring (I have also thrown in a few DoEvents for good measure!). The error occurs whether I have the script window open and execute from there or from BusinessObjects 'Tools - Execute script).
What is very strange is that if I have the report open already and then run the script (BusObj puts up a message that the report is already open, changes will be lost, do you wish to open the report again etc - I click ‘Yes’) and the script works fine. Why this is so odd is that BusObj closes the report and then the script opens it etc. I can’t see the difference between
having the report alread open, closed by BusObj, opened by the script and then the rest of the script run
and
opened by the script and then the rest of the script run
Even adding a sub routing to open the document before opening it again (to mock the behaviour of 1.) doesn’t work.
Regards
Jonathan
Project Leader
Global Medical, Regulatory and Product Strategy (GMRPS) IS
From: Johan de Waardt [SMTP:Johan.de.Waardt@nl.abnamro.com] Sent: 03 September 1998 11:29
Jonathan,
There is a bug in Business Objects which may be related to your problem.
The problem occurs when the BO script runs in the background or when dialogboxes are popping up whilst running the script (which also forces the script in the background).
The workaround we use:
-Avoid any kind of interaction when running the script -Use: myApp.Interactive = FALSE to disable all Business Objects interaction
-Use: AppActivate “BusinessObjects - [arm_wtch.rep]” to make BO the foreground application.
I had the same problems by using the “Save As Html” option in BO and I found out that the length of the Reports tab name made the export function crash!!!
So try to set small report names inside your document and it may work with DAS…
"I have a script which compiles perfectly ok BUT only runs succesfully
sometimes. What is happening is that as a call to ExportAsHTML is made, the script causes a Dr Watson error. This, as I said, is not happening everytime the script is run so can’t directly be anything to do with the code per se."