Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AddDiagram Not woring in Excel 2007



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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default AddDiagram Not woring in Excel 2007

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" wrote in message
...
|
|
| 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 ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default AddDiagram Not woring in Excel 2007

On a hidden sheet in your workbook / add-in insert the diagram while in
Excel 2003. Then just copy it when needed in Excel 2007

Robert Flanagan
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"shilpa r" wrote in message
...


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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 files not showing on screen when opened in Excel 2007 [email protected] Setting up and Configuration of Excel 1 January 8th 09 05:45 PM
Conflict in excel 2007 with Outlook 2007 attachment excel narnimar Excel Discussion (Misc queries) 0 December 17th 08 02:02 PM
Labels: Unable to import all records Excel 2007 to Word 2007 Mailm skelly Excel Discussion (Misc queries) 1 October 29th 08 11:22 PM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM


All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"