PDA

View Full Version : word chart edit data inactive after macro is run



binko
05-09-2012, 04:52 AM
Hi all,

i run a macro that edista data for several charts in a word document.

Occasionally in any one of the charts the macro fails on method CHartData.Activate

tha field edit data of the chart also becomes inactive

it seems the embedded excel sheet is deleted

no idea how to proceed with this problem

thanks all for your help,
Binko

Frosty
05-09-2012, 06:22 AM
The only way to proceed with an occasional problem is to be able to reproduce at will. You haven't given enough details (probably because you don't have those details) to be able to do more than suggest.

OLE objects have issues. See if you can find a way to break the object always. See if you can reliably fix the object by something like restarting word.

You have to narrow down your criteria. If it is occasional, then write code to make it more frequent. Activate/deactivate 100 times in a row.

Also, this kind of problem almost certainly requires telling us what version of word you're dealing with. They all have different bugs.

binko
05-09-2012, 06:35 AM
Hi,

It was due to this excel problems.

It seems that during activation or closing the excel application, the chartdata.workbook of a graph gets corrupted.

it is not linked to an external excel file but internal - the graphs are manually inserted in the word doc.

the version I am working with is MSOffice Professional 2010.

I am not so experienced with VBA.

Thank you for your kind answer.

Binko