PC Review


Reply
Thread Tools Rate Thread

AddDiagram Not woring in Excel 2007

 
 
shilpa r
Guest
Posts: n/a
 
      29th Dec 2008


Hi,

I am trying to insert a diagram using adddiagram it is showing the
error in excel 2007 same code works in excel 2003

My code is below

Dim wksActiveSheet As Worksheet
Dim shDiagram As Shape

Set wksActiveSheet = ActiveSheet
Set shDiagram = wksActiveSheet.Shapes.AddDiagram( _
Type:=msoDiagramRadial, _
Left:=20, Top:=40, _
Width:=400, Height:=200)

Any ideas on how to
programatically add a diagram in excel 2007 ?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      29th Dec 2008
Your code does run in Excel 2003 and fail in 2007. The AddDiagram method of
the Shapes object appears to have been "deprecated" as it no longer appears
in the Object Browser (unless you display hidden members) and it certainly
seems to be broken. MS totally revamped the drawing engine in 2007 and
you'll have to find a new way to do what you want in 2007, if it is even
possible. Can you manually create what you want in 2007? Unfortunately,
even if you can, the macro recorder will not record your actions so you'll
have to devise the code to do it by studying the object model. Or maybe Jon
Peltier can help<g>.

--
Jim
"shilpa r" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
|
|
| Hi,
|
| I am trying to insert a diagram using adddiagram it is showing the
| error in excel 2007 same code works in excel 2003
|
| My code is below
|
| Dim wksActiveSheet As Worksheet
| Dim shDiagram As Shape
|
| Set wksActiveSheet = ActiveSheet
| Set shDiagram = wksActiveSheet.Shapes.AddDiagram( _
| Type:=msoDiagramRadial, _
| Left:=20, Top:=40, _
| Width:=400, Height:=200)
|
| Any ideas on how to
| programatically add a diagram in excel 2007 ?
|
| Thanks
|
| *** Sent via Developersdex http://www.developersdex.com ***

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Links are not woring Pietro Microsoft Access 1 6th Jul 2008 03:47 PM
USB ports not woring right =?Utf-8?B?b21nX3JhY2U=?= Windows XP Performance 4 18th Nov 2007 01:05 PM
Code not woring - please help!!! Sue Microsoft Excel Programming 4 23rd Mar 2006 12:21 PM
Formula not woring donny Microsoft Excel Worksheet Functions 0 18th Aug 2003 07:17 PM
internet offline not woring steven Windows XP Networking 0 15th Aug 2003 11:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:47 AM.