DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking whether a report object is open or not

Hi,

 

When using the following line:  

report.Settings.UseChannelReferenceByName     = True 'Insure compatibility for autoscale

 

I rarely but sometimes receive the following error: "Access via the REPORT-OO-API is only permitted if no REPORT objects were opened using GraphObjOpen or similar commands.


How may I check if one is open? And how to close all of them ?

Thanks

 

L911

0 Kudos
Message 1 of 3
(2,855 Views)

Hi L911,

 

The best option is to completely replace the old GraphObj... commands and variables in favor of the Report object approach.  Obviously there's a lot of GraphObj... code out there, and in practice this takes time.  What I recommend while you slowly replace GraphObj... code with Report object code is to keep them encapsulated/separated from one another.  Any time you use a GraphObjOpen() command, make sure you issue all the GraphObjClose() commands before you use the Report object next.  If you have multiple GraphObj... levels open (graph >> axis or curve), then close out of ALL levels before using the Report object.  This may mean you have to restructure your existing GraphObj... code some and include extra GraphObjOpen() and GraphObjClose() commands, but I've found it manageable during the transition.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 3
(2,828 Views)

Hi,


Thanks for the answer and sorry for the delay in mine.

 

I always close every graph, and strangely, the problem came from something completely different.


I made a couple of researches in the code and I did not even open a graph. The error displayed by Diadem was just incorrect.

 

I was working hard then and I do not remember the exact cause of the problem, sorry for not being able to report it.

 

THanks though.

 

L911

0 Kudos
Message 3 of 3
(2,766 Views)