Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2005

Tip: Looking for answers? Try searching our database.

Need to change linked graphs Excel-source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas - 05 Jul 2005 07:32 GMT
I´m using Office 2003
I have a lot of linked Excel-graphs (60) in my Word document. I want to
change the source-file by code.
I think I can use the properties ProgID and Linkformat to do this.
But when I type in this little testcode:

Sub test()
   Dim s As Shape
   For Each s In ActiveDocument.Shapes
       Debug.Print s.OLEFormat.ProgID
   Next s
End Sub

I always get the error:
"Object variable or With block variable not set"
I can´t understand what i have missed to declare.
Anyone have an idea of whats wrong or if some other method is better to use?
Cindy M  -WordMVP- - 05 Jul 2005 09:15 GMT
Hi =?Utf-8?B?VGhvbWFz?=,

Do you have graphical objects in the file that aren't OLE objects?
Pictures, for example? If you try to run this on another kind of Shape,
you'll get that error message (I just tested). Take a look in the
ObjectBrowser at the Enums for the Type property of the Shape object.
There should be one in there that tests whether it's OLE.

> I´m using Office 2003
> I have a lot of linked Excel-graphs (60) in my Word document. I want to
[quoted text clipped - 12 lines]
> "Object variable or With block variable not set"
> I can´t understand what i have missed to declare.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Thomas - 05 Jul 2005 21:11 GMT
Maye I´m wrong

I have made my linkes this way.
Multiple graphs has been (from different sheets in same .xls-file)
linked to a 70 page word document (on various sheets) by "copying" the
graph(s) in the Spreadsheet and then "pasting special" onto the word
document as an MS Office Excel Chart Object. I have also copied cells and
"paste special" as formatted text.

I hope you can give me some ideas

Hälsningar
Thomas

> Hi =?Utf-8?B?VGhvbWFz?=,
>
[quoted text clipped - 28 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Cindy M  -WordMVP- - 07 Jul 2005 10:20 GMT
Hi =?Utf-8?B?VGhvbWFz?=,

> I have made my linkes this way.
> Multiple graphs has been (from different sheets in same .xls-file)
> linked to a 70 page word document (on various sheets) by "copying" the
> graph(s) in the Spreadsheet and then "pasting special" onto the word
> document as an MS Office Excel Chart Object. I have also copied cells and
> "paste special" as formatted text.

If you press Alt+F9 to toggle the field codes do you see LINK fields? If you
do, then these are InlineShapes, not Shapes. But my question still remains:
have you inserted other things into the document, as well?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.