I find that the harder I work, the more luck I seem to have.
- Thomas Jefferson
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Export a graph from a Visual Basic to Powerpoint.
by: Naveen Raju
Description:
This piece of code exports a graph (pie or line or other graphs) to power point and saves as presentation.
Code:
Private Sub PPTExport_Click() 'Adddin refernce Dim objPPApplication As New PowerPoint.Application Dim objPPPresentation As New PowerPoint.Presentation Dim objPPSheet As New PowerPoint.Slide Dim fs As New FileSystemObject if chart_object.SaveImageAsJpeg("Call1.jpg", 100, False, False, True) = True then 'Saves the graph displayed on the chart to .jpg format, Also can save to .bmp etc formats Set objPPPresentation = objPPApplication.Presentations.Add 'Adds a presentation Set objPPSheet = objPPPresentation.Slides.Add(1, ppLayoutBlank) 'Adds a blank slide objPPSheet.Shapes.AddTextbox 1, 60, 30, 100, 40 'Adds a text box to fill in some text. objPPSheet.Shapes(1).TextFrame.TextRange.Text = "Naveen" 'Adds text to the added textbox. objPPSheet.Shapes.AddPicture "File_ Name ", 1, 1, 35, 60, 650, 300 'To add the file(.jpg or .bmp etc) objPPSheet.Shapes.AddOLEObject 150, 380, , , , "File_name" 'To add a object to the slide like(excel template showing grid vales etc) 'Prior to the above piece of code u need to save the values form the grid to excel template and then embed this template to the presentation using the above piece of code. Set objPPSheet = objPPPresentation.Slides.Add(2, ppLayoutBlank) ' Adding second slide to the same presentation file. objPPPresentation.SaveAs "Destinatio.pps", ppSaveAsShow, msoCTrue If fs.FileExists("file_name.jpg ") Then fs.DeleteFile "file_name.jpg ", True End If objPPPresentation.SlideShowSettings.Run end if End Sub
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
3,375
Views
0
Total Comments
0
Rating of 5 (
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
Text Editor
·
Adder
·
Combo Box Colors
·
Cut and Paste
·
Flag Viewer
Car Insurance
-
Flights
-
Loans
-
Guitar Lessons
"AllSyntax.com" Copyright © 2002-2007; All rights lefted, all lefts righted.
Privacy Policy
|
Internet Rank