Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / December 2006

Tip: Looking for answers? Try searching our database.

How to prevent showing default graph

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ZM - 24 Dec 2006 10:31 GMT
Hi,

I'm trying to make Chart as OLE Object using MSGraph.Chart.8 in
PowerPoint, and I am using VB.Net as programming language. The problem
is that as soon as my code reaches the line oShapes.AddOLEObject(150,
150, 480, 320, "MSGraph.Chart.8") it displays a 3D multibar gragh on
the slide which is probably the default graph. Whereas I want to change
the type of the graph and give my own data to show on the slide. I'm
able to change the type and data of the graph. When I ask my
application to add graph to a slide in the running slide show It first
displays the default graph with default values and then the graph which
I want after some pause. I want to somehow prevent displaying default
graph and only display the graph after I change it's type and set the
data values I want to show on the graph.

Here is the code I'm using to make graph:
       Dim oSlide As PowerPoint.Slide
       Dim oChart As Graph.Chart
       Dim oShapes As PowerPoint.Shapes
       Dim oShape As PowerPoint.Shape
       Dim oOLEFormat As PowerPoint.OLEFormat

       oSlide = oSlideShow.Slide
       oShapes = oSlide.Shapes
       oShape = oShapes.AddOLEObject(150, 150, 480, 320,
"MSGraph.Chart.8")
       oOLEFormat = oShape.OLEFormat
       oChart = oOLEFormat.Object

       oChart.ChartType = Graph.XlChartType.xlColumnClustered

       oChart.Application.DataSheet.Cells.Clear()
       oChart.HasLegend = False

       oChart.Application.DataSheet.Range("A0").Value = "Option 1"
       oChart.Application.DataSheet.Range("B0").Value = "Option 2"
       oChart.Application.DataSheet.Range("C0").Value = "Option 3"

       oChart.Application.DataSheet.Range("A1").Value = 10
       oChart.Application.DataSheet.Range("B1").Value = 20
       oChart.Application.DataSheet.Range("C1").Value = 30

       'Nothing to release references.
       oChart = Nothing
       oOLEFormat = Nothing
       oShape = Nothing
       oShapes = Nothing
       oSlide = Nothing

How should I modify this code to achieve above stated objective.

Regards,
Zeeshan.
Cindy M. - 24 Dec 2006 17:28 GMT
Hi Zm,

> I'm trying to make Chart as OLE Object using MSGraph.Chart.8 in
> PowerPoint, and I am using VB.Net as programming language.

Then this is not the appropriate group to ask your question. VSTO
does not equal "questions about Office application". VSTO is a
special technology.

The best place to ask this would be the powerpoint newsgroup.
Next best the office.developer.automation newsgroup. But your
chances of getting help are better in the PowerPoint newsgroup.
Be sure to mention which version of Office you're working with
when you ask.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17
2005)
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 :-)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.