Requested Operation Is Currently Disabled

D

Denis Zavadil

Software being utilized: Microsoft Development Environment 2003 Version
7.1.3088
Microsoft Framework 1.1 Version
1.1.4322
Microsoft Office Visio Professional
2003 (11.3216.5606) - Active X control

I have developed a component which imports data from an external source to
refresh data in existing Visio Documents. The data being refeshed consists
of a number of individual text shapes which have been grouped and glued to a
geometric shape. The application iterates through the geometric shape
collection, for each shape extracts a shapesheet property which is a unique
key to data on a web service. When a key is found a request is sent to the
web service, an array of string is returned. The group of text shapes
attached to the geometric shapes is ungrouped, the individual text shapes
are deleted and the array of strings replaces those deleted and grouped.

Occasionally there is an application error when trying to ungroup the
original block of text shapes. The error message is: Requested Operation is
Currently Disabled. This seems to be an intermittent problem and does not
seem to have a consistent pattern. My assumption was that there may be an
issue with application code executing faster than the Visio ActiveX control
is processing the requests. I've inserted a DoEvents statement prior to
each ungroup which hasn't made any difference.

What does the message Requested Operation is Currently Disabled mean, how
does the application get in this state and is there a means of preventing
this from happening?
 
B

Bill K. [MSFT]

The error message "Requested Operation is Currently Disabled" can occur when
an automation method is invoked when Visio is busy, such as when Visio is in
an undo, redo, or shape delete scope (among others). Ungrouping a shape
causes shape delete and parent change events to fire which will put Visio in
this state.
My first guess is that the web service is asynchronous and data is returned
at unpredictable time intervals. If the code tries to write to Visio shapes
when the data is returned from the web service, that could cause this kind
of intermittent error.

A good way to find out if this is happening is to run the Event Monitor and
look at the event stream that led up to the error.
The Event Monitor is included in the Visio SDK which is a free download from
here:
http://www.microsoft.com/downloads/...80-6634-4703-9ad9-7e440ede12d7&displaylang=en

If you solution has an event sink, try queueing the returned data from the
web service and make all changes to the drawing in a NoEventsPending event
handler.


Hope this helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top