Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Paste Charts From Excel To Powerpoint Slides


Hi
I have an Excel sheet in which there are some charts. I want to copy each of these charts and paste them on a separate slide in a powerpoint presentation through VB. How do I do that. Can anyone help me out




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Delete Powerpoint Slides Through Excel VB Macro (with Condition)
I was wondering if someone can help me with this problem.

After my presentation slides are created, I want to delete specific specific slides that do not have a Graph image. My excel macros export graph images to certain templates in my ppt slides. However, if this graph image is not on the template at all, I just want to delete the slide from the presentation.

So far (havent tested or anything, just logic, probably poor since im inexperienced)

Sub DeleteSlides()

Dim Pre As Presentation
Dim Sld as Slide
i As Integer
'Graph As Object ????

i = 50

Set Pre = ActivePresentation 'OR Sld = ActivePresentation.Slides(i)

For i = 50 to 55

If ActivePresentation.Slides(i).HasGraph = False Then
Set Sld = Pre.Slides.Delete(Index: = i) 'OR Sld.Delete

End If

End Sub



If anyone can offer some input for my problem, this would be greatly appreciated.

Keep in touch.

Thank you.

Export Charts From Excel Into PowerPoint
Hi everyone, I need to export a chart from Excel into PowerPoint on multiple slides.  I got this code to work!  The problem is that I want it to place the charts on lets say slides 1, 3, and 5.  Right now the code places the chart in sequencial order.  I was thinking for the if statement to place a statement like the:

'If slideindex = 1 or slideindex = 3 or slideindex = 5 Then'

Please help!

Sub TestNew()

Dim objPPT As Object
Dim objPrs As Object
Dim shtTemp As Worksheet
Dim chtTemp As ChartObject
Dim intSlide As Integer
     
Set objPPT = CreateObject("Powerpoint.application")
objPPT.Visible = True
objPPT.presentations.Open ThisWorkbook.Path & "TestPP.ppt"
     
For Each shtTemp In ThisWorkbook.Worksheets
      For Each chtTemp In shtTemp.ChartObjects
      intSlide = intSlide + 1
      chtTemp.CopyPicture
      If intSlide > objPPT.presentations(1).Slides.Count Then     'I think this if statement needs to be changed
          objPPT.ActiveWindow.View.GotoSlide Index:=objPPT.presentations(1).Slides.Add(Index:=intSlide, Layout:=1).slideindex
       Else
          objPPT.ActiveWindow.View.GotoSlide intSlide
       End If
       objPPT.ActiveWindow.View.Paste      'This may have to be moved if the if statement is changed
   Next
Next
    
Set objPrs = Nothing
Set objPPT = Nothing

End Sub


Thanks in advanced!

Urgent Copy Charts From Excel To Powerpoint
Hi all!!

I hope there is someone who can help me, I really need to finish this work as soon as posible...

I have an Excel file containing some charts...
I need to do a macro to copy these charts into a powerpoint file

I have tried the following code but it does not work
Please, can you help me?
Many thanks in advance

Using Excel Data To Create Charts In PowerPoint
Is there a way to take values located in Excel and use these values to create a Powerpoint chart?

For example, assume that I have the following info in Excel:
cell B1: 1st Quarter
cell C1: 2nd Quarter
cell A2: AOL
cell A3: MSFT
cell B2: 25
cell C2: 30
cell B3: 10
cell C3: 5

Is there a way to take this information and use it to create a chart in Powerpoint?

If someone knows how to do this, would you please post sample code?

Powerpoint Slides
How can I make my macro advance to a certain slide number in the presentation?

Any help much appreciated.

Powerpoint Slides & Vb
Hi
I'm trying to write an exam in powerpoint. Each slide is a multiple choice question and has a hidden textbox containing the student's score for that question.

At the start the user presses a command button to start the exam and the code:
slide2.score.text =0
slide3.score.text = 0
etc etc works fine, however when I dim an array and try..
for x = 1 to 50
slide(x).score.text =0
next x
it does not work... any ideas?
Ta

Powerpoint Slides
I have trawled through the posts on Powerpoint and can't find any info on.......

Identifying text frames on a slide - is there any way to identify a text frame in Powerpoint slide? I am trying to add text to various (existing) text frames in code but can't easily identify the frames without recording quick macros to select a frame and looking at the code to see which frame I have just selected...

Also has anyone seen any code to display a single slide within a VB form?

I am trying to write a program that will show a thumbnail list of Powerpoint slides and am getting nowhere fast as I can't even display a single slide!

The other way around it would be to generate jpg images and show these but I don't want to if possible.

Any help appreciated
Thanks

PowerPoint Slides
Hey,
I inserted a powerpoint presentation on to a form but i need help programming the command buttons to go to the next slide.
Thanks,
VB Rookie

Powerpoint Renaming Slides
I would like to rename a powerpoint slide for example slide 1 would be renamed title page. Does anyone have any ideas on ways to do this or if its possible or not?
Thanks

Loop Through PowerPoint Slides
Well, I've nearly finished the presemtation i've been working on. The last thing I need is to number all the slides!

This is awkward because the numbering should start on the third slide, and the number of slides will be different every time the document is used.

This has led me to believe I need some kind of loop to run through all the slides and stop when there are no more slides left. However, I have no clue whatsoever about loops

I want the page number to appear in "TextBox4" on every page.

Can anyone help me out?

Powerpoint Slides In Access
I have an table contained in an Access database, and what I want to do is to open a Powerpoint presentation and copy the slides into the table as individual entries.

E.g. If a presentation contained 10 slides then the table would contain 10 entries, where each entry is an individual slide from the presentation.

Any ideas on how I can achieve this?

Is It Possible To Link Slides In Powerpoint To VB
good day over there, am trying to think if it is possible to link slides prepared in powerpoint to vb so that it can be packeged as an excutable file then it can be written on CDs and be ready for installation on any system.
does anybody have the idea?


Get Number Of Powerpoint Slides In VBA
i need VBA code for a procedure to allow a user to select a power point file and return the number of power point slides and also the number of hidden slides i have tried many differing methods and have created code to return the total number of slides but i cant create code to firstly count the number of hidden slides then show the result in a message box
hope someone out there can help
much appreciated
nidge

edit:: Changed title. -Metallisoft



Edited by - Metallisoft on 6/29/2004 8:49:52 AM

Reading Result From Other Slides In Powerpoint
Dear all

I am new in using VBA with Powerpoint, so I hope someone can help me in doing these:

1. I have one silde there is some combo boxes which will show some option
for users to choose.

2. For the superuser who can input options into the combo boxes in another
slide by textfield.

My question is : How can I get the result from the text field in slide 2 to
the combo box in slide 1.

I have tried to Public the variables to store the text for the text field in slide 2
and in slide 1, i have try to access the those varable in slide 2 .

But nothing happen. What command I can use to access anything from other slide?
Thanks a lot for helping me !!

Powerpoint: Erasing Notes From All Slides
Hi guys,

I just found this message board and I was wondering if it was possible to erase the notes in powerpoint from all the slides. I'm making an addin for powerpoint and I'm trying to include this feature. I've posted what I got so far and it only erases the note box from slide #1 but won't move to the next slide.
Another thing I want to do with the addin is to put a button in the toolbar that will bring up the Line Spacing dialog box. I'm not sure how to call this up.
Any help will be appreciated.
sub No_Notes()
' This Macro vists every slide within every active presentation.
Dim numberofpresentations As Integer
Dim numberofslides As Integer

' Declare the variables for loops.
Dim x, y As Long

' Retrieves the total number of open presentations.
numberofpresentations = Application.Presentations.Count

' Loops through every open presentation.
For i = 1 To numberofpresentations

' Set pres = Application.Presentations(i)
' Counts the number of slides within the current presentation.
numberofslides = Application.Presentations(i).Slides.Count

' Goes through every slide in the presentation.
For j = 1 To numberofslides


With Application.Presentations(i).Slides.Item(j)
With ActiveWindow
.ViewType = ppViewNotesPage
.Selection.SlideRange.Shapes("Rectangle 3").Select
.Selection.ShapeRange.TextFrame.TextRange.Select
.Selection.ShapeRange.TextFrame.TextRange.Select
.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=100000).Select
.Selection.TextRange.Text = ""
.Selection.SlideRange.Shapes("Rectangle 2").Select
.Selection.Unselect
.ViewType = ppViewNormal
End With
End With
Next j

Next i

End Sub

Display A Web Page In Microsoft PowerPoint Slides
Hi,

I am trying to display a web page on a PowerPoint slide. The main idea is that, the webpage uses JavaScript to refresh an online image every second. Could anyone let me know how to do that? Thanks a lot.
Gang

Run A Powerpoint Application Through And Display Each Slides Starting && Ending Time
i want to run powerpoint application through vb and display each slides starting time & ending time i.e. if the slide starts at 00:00:00 and ends at 00:02:38,this should be displayed in a text file called pplog.txt.Then the second slides starting time will be the first slide ending time and so on.the coding i have done is as follows.On the form level it is :

Dim PpApp2 As New PptClass.clsPpt

Private Sub mnuexit_Click()
    Unload Me
End Sub

Private Sub mnuopen_Click()
    
    dlgopen.Filter = "presentations/*.ppt"
    dlgopen.ShowOpen
 
    Set PpApp2.ppApp = CreateObject("Powerpoint.Application")
    PpApp2.ppApp.Visible = True
    Set PpApp2.ppPres = PpApp2.ppApp.Presentations.Open(dlgopen.FileName)
        
    PpApp2.Showstart

End Sub


And on the class module it is:

Option Explicit

    Public ppApp As powerpoint.Application
    Public ppPres As powerpoint.Presentation
    Dim fso, f1, cnow, ctime, i As Variant

Public Sub Showstart()
              
       Set fso = CreateObject("Scripting.FileSystemObject")
       Set f1 = fso.CreateTextFile("c:pplog.txt", True)

       For i = 1 To ppPres.Slides.Count
                             
           With ppPres.Slides.Range.SlideShowTransition
                .EntryEffect = ppEffectRandom
           End With
          
           With ppPres.SlideShowSettings
                .ShowType = ppShowTypeSpeaker
                .RangeType = ppShowAll
                .StartingSlide = 1
                .EndingSlide = ppPres.Slides.Count
                .Run
           End With
                      
           cnow = Format(Now, "hh:mm:ss")
           ctime = "00:00:00"
           ctime = ppPres.SlideShowWindow.View.SlideElapsedTime
           f1.WriteLine (cnow & " - " & ctime & " slide" & i)
           f1.WriteBlankLines (1)
' cnow = ctime + cnow
       Next
                 
           If i < ppPres.Slides.Count Then
                 Call ShowNext
           End If
       
      Call ShowNext
     f1.Close
     ppApp.Quit
End Sub

Public Sub ShowNext()
    If ppPres.Slides.Count = ppPres.SlideShowSettings.EndingSlide Then
        MsgBox "This was the last slide ", vbOKOnly
    End If
End Sub

'''Public Sub ShowEnd()
''' f1.Close
''' ppApp.Quit
'''End Sub

Public Sub nextslide()
    
    MsgBox " current slide number is " & i
    
End Sub

I am getting an error when i try to add the two time varaiables.

Powerpoint And Charts
Does anyone know how, or know where I can find information to generate a chart in powerpoint from visual basic. Basically I create the entire slide show in VB adding info and bullets. The only thing I can't do is automatically generate the chart.

Well - Powerpoint Charts
I want to create a bar chart in PowerPoint thru VB code.

After I set up the Powerpoint object, then what? Please help...

VB Macro: Copy && Paste Charts To Word
Hello all,

I am writing an application to generate reports. After a huge process I get a workbook full of charts and tables, which I want to paste in a report template where I placed a few bookmarks.

I tried the following code and it worked just fine for the first chart. However, the execution hangs and I cannot paste the rest of my charts.

Anyone can help? Why is the execution stopping? Am I using a correct approach?


Code:
Sub FindnReplaceBookmark()

Set objWord = CreateObject("Word.Application")
Set WordDoc = objWord.Documents.Add("C:Dot1.dot")
Sheets("MyChart").Activate
ActiveChart.ChartArea.Copy
WordDoc.Bookmarks("MyChartBookmark").Range.PasteSpecial Link:=False, & _
DataType:=wdPasteMetafilePicture, Placement:=wdFloatOverText, & _
DisplayAsIcon:=False

'This is where the execution stops, just before I want to copy&paste
'the rest of my charts.

Sheets("AnotherChart").Activate
ActiveChart.ChartArea.Copy
WordDoc.Bookmarks("AnotherChartBookmark").Range.PasteSpecial Link:=False, & _
DataType:=wdPasteMetafilePicture, Placement:=wdFloatOverText, & _
DisplayAsIcon:=False


Set WordDoc = Nothing
Set objWord = Nothing
End Sub
I really appreciate your time and help.

Cheers,
Julián

Copy/paste Wrksht With Embedded Charts
I am using a template worksheet that has a few tables with charts associated to them.

I copy paste the worksheet as many times as needed then delete the template sheet.

The problem I am having is that the charts still maintain the data source to the template worksheet.

Is there a way to make the data source of the charts always use the current sheet?

Is this something I need to do in the code which does the copy/paste, or is it something I need to do in the Excel Template file?


Here is the code I have for copying the worksheets.

Code:
'## Add a worksheet for each phase of the project ##
For X = 0 To PR_NumOfPhases - 1
strPhaseName = Project.PR_ProjectPhases(X, 1)
WorksheetName = strPhaseName & " Phase"
Set xlsheet = xlbook.Worksheets.Add(After:=xlbook.Worksheets(xlbook.Worksheets.Count))
xlsheet.Name = WorksheetName
Set xlsheet = xlbook.Worksheets(WorksheetName)
xlbook.Worksheets("Phase Data").cells.Copy
xlsheet.Paste
Next X
'## Delete the Template Sheet ##
xlApp.DisplayAlerts = False
xlbook.Worksheets("Phase Data").Delete

Any help would be greatly appreciated...

How To Paste Special Into Powerpoint?
Hi,

I have written code that takes Excel Graphs and pastes them into Powerpoint. However can anyone please tell me how i can get the graphs pasted as 'Microsoft Excel Chart Objects' ? (i.e. as aloud on the paste special menu) as i can find this code anywhere.

Cheers!

Charts In Excel!!
Can anybody help me???

I have an Access database which exports data automatically on a weekly basis to an Excel workbook. So far so good. But now I want to display the exported data in the form of a chart. Since the data is exported weekly, at the moment I'm having to manually update the chart. Is there some way of automatically updating the charts either when the Excel workbook is opened or even via the export procedure that I have got in Access?

Any suggestions/help/sample code will be gratefully received.

Excel Charts
I have to print multiple charts on the same worksheet.the code runs fine when it the application runs for the first time , but if I run the application again using same parameters or even any parameter it raises an error or prints the chart one on top of other.. I am not able to release the variables.I have used wbook.close and have set the variables to nothing., but still the problem is there when the application runs for the second time without closing.I cannot close excel application

Excel Pie Charts
I have two sets of data

data1:
city name, value
city name, value
...

data2:
city name2, value2
city name, value
...

Now, when I pie the charts(2 seperate charts), each piece of the pie is a different color, how can I make each pieice sorted by city name correlate in 2 different graphs?

how does excel determine which pice gets which color? random?

I thought about using a macro, but VBA seems to assign each peice of pie as a point number and not a name, any ideas?
thanks
-Steve

Excel Charts
Dear All,
I have a data range like this

A B
1 Name Age

2 Dave 14/05/07
3 Mike 16/07/08
4 John 18/09/10

What I want to do is after each time I add a new name for the graph to update minus the first name entered. So let's say I add a new name Steve, I want the graph just to show Mike, John and Steve and remove the rest from it. Is this possible and how do I do it without it being manual?

Thank you in advance

Excel Charts With VB 6
HEllo,

How are u

i have a code, i dont know whats wrong with it, it does'nt work with VB 6




Code:

Dim xlWB1, xlWB2 As Excel.Workbook
Set xlApp = New Excel.Application
' xlApp.Visible = True
xlApp.Visible = False

Application.ScreenUpdating = False



Set xlWB2 = xlApp.Workbooks.Open(CurDir & "" & "KSEINDEX.xls")


Call DELETECHARTS
Call mkChart

End Sub






Code:
Sub DELETECHARTS()

Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets


wks.ChartObjects.Delete



Next wks

End Sub





Code:
Sub mkChart()
Dim wks As Worksheet
Dim rng As Range
Dim cht As Chart


For Each wks In ActiveWorkbook.Worksheets


Set rng = wks.Range(wks.Range("A3"), wks.Range("A" & wks.Cells.Rows.Count) _
.End(xlUp).Offset(0, 1))
Set cht = Charts.Add
Set cht = cht.Location(Where:=xlLocationAsObject, Name:=wks.Name)

With cht
.ChartType = xlLine
.SetSourceData Source:=wks.Range(rng.Address), PlotBy:=xlColumns
.HasTitle = True
.ChartTitle.Characters.Text = wks.Name


On Error Resume Next
.HasDataTable = False
.HasLegend = False


With .Axes(xlCategory)
.TickLabels.NumberFormat = "[$-409]mmm-yy;@"
.MinimumScaleIsAuto = True
.MaximumScaleIsAuto = True
.BaseUnitIsAuto = True
.MajorUnit = 1
.MajorUnitScale = xlMonths
.MinorUnitIsAuto = True
.Crosses = xlAutomatic
.AxisBetweenCategories = True
.ReversePlotOrder = False
End With

.PlotArea.ClearFormats

With .Parent
.Top = wks.Range("G5").Top
.Left = wks.Range("G5").Left
.Height = 350
End With
End With




Next wks

MsgBox "Done"
End Sub





Error Start with this code :
Set cht = Charts.Add
Set cht = cht.Location(Where:=xlLocationAsObject, Name:=wks.Name)

...
.
.
.
.

..
.




please kindly help me


or which reference do i have to Enable/USE

thanks

VB6 And Excel Charts
Hi,
I'm new to VB and to the forum as well.
Is there a way that I can automate building a chart in excel from VB6 application, then displaying that chart in the applcation instead of excel?

Excel Charts And VB 6.0
I did the following:
Set objXLApp = New Excel.Application
sTest = "D:/MacroVB/SegFiles/" & ListExcelFile.List(counter - 1)
Set objXLBook = objXLApp.Workbooks.Open(sTest)
objXLApp.Visible = False
...this works.

The workbook has several sheets and 2 charts in the sheet Output.
How can I export those charts as a jpg file from the workbook...
Does I have to create an OLE object?...Embedded?
How to focus on the charts? ...for export

Thanks for your help,
Frans

Excel Charts
Can anyone help me. I have been trying to get a VB program to display various charts created in excel 97. So far, I have not found any information on doing this, but working between VB and VBA with macros recorded, I have managed to work out some of the (maybe) necessary methods. Unfortunately, this is about as far as I have fot. I didn't really want to use the OLE function in VB, but may have to. If anyone can tell me how to do this, I will be very grateful. As an indication, I have been trying to use the data in one excel spreadsheet, to create a chart and then display it in VB. Dont know if this is the right way to go, as I haven't had that much experience with VB

Any help, gratefully appreciated

Thanks

Darren

Excel Charts And VB
I am developing an application where I would like to show an existing Excel chart in VB6. My (limited) experience to-date has been with transferring values to and from Excel (see below)


Code:
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(App.Path & "DummyUpdated.xls", , True)
Set xlSheet = xlBook.Worksheets(1)
'
'Do some data manipulations
xlRows = 3
MyValue = xlSheet.Cells(xlRows, 4).Value
MyNewValue = 400
xlSheet.Cells(xlRows + 1, 4).Value = MyNewValue
'
'When finished, close the Excel file
xlApp.Workbooks.Close
xlApp.Quit
Set xlApp = Nothing
With a bit of tweaking this code, I could also change an existing Chart in Excel (because the chart and data are already linked within the workbook). But can I then bring a copy of this chart into VB using the picture or image control (on the fly)? Within Excel I have done this with a Userform by converting the chart into a gif image and then copying and pasting the image into a picture control. I would like to do the same thing in VB6, if possible.

I've searched this site and have not been able to find an answer - much has been discussed about how "useless" VB is when dealing with MSCharts - so if I can code for a simple "cut and paste", I'd be happy.

Any comments/suggestions?

Stan

Going Through Charts In Excel With VB
I have a question, how would you loop through a bunch of charts. What I am trying to do is find a chart and if it is there, delete it. This is what I have and it's not finding the chart that I'm looking for.

Dim wSht As Chart
Dim nameofchart As String
Dim x As Integer

nameofchart = "Days In WC"

For Each wSht In Sheets
MsgBox (wSht.Name)
If wSht.Name = shtName Then
Worksheets("Days In WC").delete
Exit Sub
End If
Next wSht

This loops through and gives me all of my charts except the one that I'm looking for and ends up giving me an error "Run-time error 13 Type mismatch" on the next wSht. This is the order the bottom of the sheets are. 7 charts, sheet 1, Days in WC Chart and Chartdata. What am I doing wrong?

Any help would be greatly appreciated.

Excel Charts
I am trying to create a graph in Excel from a VB program.
I have recoreded the macro in Excel, and pasted it into the VB program, but when I try to run the program, I get the following error 1004 - Method 'SeriesCollection' of object '_Chart' failed.
The code I am trying to execute is :

With objExcel
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection(1).XValues = "={""Week Number""}"
ActiveChart.SeriesCollection(1).Values = "=EXCEL!R2C1:R54C1"
ActiveChart.SeriesCollection(1).Name = "=""Week"""
ActiveChart.SeriesCollection(2).XValues = "={""Week Number""}"
ActiveChart.SeriesCollection(2).Values = "=EXCEL!R2C2:R54C2"
ActiveChart.SeriesCollection(2).Name = "=EXCEL!R1C2"
ActiveChart.SeriesCollection(3).XValues = "={""Week Number""}"
ActiveChart.SeriesCollection(3).Values = "=EXCEL!R2C3:R54C3"
ActiveChart.SeriesCollection(3).Name = "=EXCEL!R1C3"
ActiveChart.SeriesCollection(1).XValues = ""
ActiveChart.SeriesCollection(2).XValues = ""
ActiveChart.SeriesCollection(3).XValues = ""

The error appears at the 4th line - ActiveChart.SeriesCollection(1).XValues = "={""Week Number""}"

The program doesn't seem to recognize the ".XValues" property.

Can anybody help me ??

Thanks.

Excel Charts
Hello All



Does anybody to know how to get hold of Chart Wizard from Excel 2000?
I wish to create a button that when pressed goes into Excel 2000 and opens Chart Wizard, so then I can select any of the charts.


If so I would be really grateful.
Thanks.

Juggy

Excel Charts
Hi there, although I know this isnt exactly a VB problem, I was wondering whether there is anyone there who knows whether it is possible to make a bar chart with 2 series. They need to be side by side and it needs to have a primary and secondary axes. I have got the secondary axis, but it then stacks the bars, is there anyway of changing this, VB or otherwise?

Cheers. Sparky

VB And Excel Charts
I'm trying to create an excel chart from inside a VB app, then I want to show that chart on a form in my vb app. I'm able to create the chart, just not sure how I can show that on a form. If anyone can help, please let me know. Thanks

Excel Charts
I am trying to generate data charts with VBA in Excel97. I'm having trouble resizing the chart (making it larger) after I create it. Does anyone know the VBA code for resizing a chart?

Excel Charts
I am trying to generate data charts with VBA in Excel97. I'm having trouble resizing the chart (making it larger) after I create it. Does anyone know the VBA code for resizing a chart?

Excel-like Charts In VB 6.0
Hey everybody,

Does VB 6.0 have a chart control that is close-to the chart objects in Excel. I need one that can display candlesticks for market information and the only chart controls that excel has don't seem to offer this type.

Using Excel Charts
Hi there, i have made a program which puts data into a spreadsheet etc etc, however i now need to extract data from a chart in excel, i need to get the chart equation, its displayed on the chart in excel, however i am not sure how to get this using VB?, can anyone help me?

Cheers

3d Charts In Excel - Please Help
I want to convert my exsisting 2d scatter line charts to 3d line charts.
For some charts iv'e set the values to the secondary y axis also. When this chart is
converted to xl3DLine the secondary y-axis is not present. any idea on how to solve this
issue ??

I also want to know how the color, of the border and the interior, of the data series on the chart
can be changed.
The interior color for me comes automatically but the border of the data series comes as black.
How do i solve this problem???

-ash

Excel : Charts!
Hello All!
I am having another problem with this VBA project.

I use the following code to create a chart :

Code:

Dim MyChart As Chart

Set MyChart = ThisWorkbook.Charts.Add
MyChart.Activate
MyChart.ChartType = xlPie
MyChart.Location xlLocationAsObject, "ProjectReport"
MyChart.SetSourceData Range("ProjectReport!J13,J15"), xlColumns


The Last Line of code is where I get an 'automation error' and I can't set the source. If anybody can help I'd appreciate it! Thanks

Edit:
MyChart.Location xlLocationAsObject, "ProjectReport"
Was what was causing my automation error!
I fixed it though!

Excel Charts
I have a chartobject that i want to apply a built-in custom type to. I have tried:
&lt;SNIP&gt;
new_chart.Chart.SetSourceData Source:=Sheets(wkname).Range(temp), _PlotBy:=xlColumns
&lt;/SNIP&gt;
but it seems to just default to a bar type. Any suggestions? Thanks for your help.

Excel 2000, Create Powerpoint Org Chart From Excel.
I want to create a powerpoint org chart from Excel using information held in Excel. I have found how to add an Org chart into Powerpoint but can't find anywhere that tells you how to change the details/options or add Subordinates Managers etc and alter those details.

Anyone have any ideas (I don't want to create seperate text boxes if possible.)

Ps if you can create a good powerpoint org chart from excel, any ideas on the best layout of information in the spreadsheet to work through and create it.

This is one of those, that would be good if you can do it (created them in the past and are time consuming pains), rather than has to be done last week ideas.

Regards.

rob.

Excel Charts Within Word Within Vb
i have a word document that contains a chart exported from excel which includes the data that the chart is plotted from.

how can i access the chart's data and change it from code in the word document?

Excel Spreadsheets And Charts
Hi,
I was just wondering if anyone could help me with creating an excel spreadsheet, putting data into it and then showing a plot of the data whilst still running my visual basic application. I'm not sure whether this is simple or complicated, i'm hoping its not too difficult.
Thanks,
Jean

Charts In Excel - Using Vb Data
is it possible to create a pie chart etc from data you have totaled in a visual basic program.

Excel Charts Will Not Display!
I have a fairly large excel spreadsheet with several charts. Last week they all displayed fine, now they are all grayed out. If I select a single chart, it will display fine, so all the information is there and correct, but suddenly, I can't get more than one chart to display. Has anyone experienced this problem?

Excel Charts Not Behaving
Hello everyone!
I've been reading this forum for a while but this is my first post.
I am working on a excel worksheet that reads data (this is engineering stress anlysis data) from an xml file and then prints a report based on user selected options. Part of the report is a chart graphing the data. My problem is that the chart building function breaks when making multiple charts. The formatting doesn't get completed and I have problems when switching from worksheet to worksheet. If I step though the code line by line it works alright but when just running the program it breaks down.

I know this isn't pretty but I would appreciate any help or comments you all could provide.

Thanks


Code:
Public Function makeGraph(refColumn As String, graphRange As Range)

'make graph for pile
Dim i As Integer, j As Integer
Dim x As String, y As String
Dim dataRange As Range, labelRange As Range
Dim first As Range, last As Range
Dim lfirst As Range, llast As Range
Dim mysheet2 As Worksheet
Dim myChtObj As ChartObject
Dim lngTop As Long, lngLeft As Long

'set graph worksheet and range
Set mysheet2 = Application.Worksheets(2)

'get location of cell
lngTop = graphRange.Top
lngLeft = graphRange.Left

'set label ranges
Set labelRange = mySheet.Range("j" & firstRow)
Set lfirst = labelRange.Offset(1, 0)
Set llast = mySheet.Range("j" & lastRow)
'set data range
Set dataRange = mySheet.Range(refColumn & firstRow)
Set first = dataRange.Offset(1, 0)
Set last = mySheet.Range(refColumn & lastRow)

'add new chart
Set myChtObj = mysheet2.ChartObjects.Add(Left:=lngLeft, Width:=200, Top:=lngTop, Height:=300)
'type of chart
myChtObj.Chart.ChartType = xlXYScatterLines

'add new series
With myChtObj.Chart.SeriesCollection.NewSeries
'error somewhere in here with multiple charts
'.Name = dataRange

'error after this line with multiple charts
.Values = mySheet.Range(lfirst, llast)
.XValues = mySheet.Range(first, last)
End With

'format chart
myChtObj.Activate
With ActiveChart
'set chart title
.HasTitle = True
.ChartTitle.Characters.Text = "PILE " & pile & " RESULTS"
.ChartTitle.AutoScaleFont = False
.ChartTitle.Font.FontStyle = "Bold"
'set x axis label
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = dataRange.Value '"AXIAL FORCES (kips)"
.Axes(xlCategory).AxisTitle.Font.FontStyle = "Regular"
.Axes(xlCategory).TickLabelPosition = xlHigh
'set y axis label
.Axes(xlValue).ReversePlotOrder = True
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = labelRange.Value
.Axes(xlValue).AxisTitle.Font.FontStyle = "Regular"
.Axes(xlValue).TickLabelPosition = xlLow
'set background color
.PlotArea.Interior.ColorIndex = 35
'delete legend
.HasLegend = False
'reposition chart and x axis caption
.PlotArea.Top = ActiveChart.PlotArea.Top - 20
.Axes(xlCategory).AxisTitle.Top = ActiveChart.Axes(xlCategory).AxisTitle.Top + 245

End With

'destroy object
Set myChtObj = Nothing
Set mysheet2 = Nothing

End Function
-Goku

Copyright © 2005-08 www.BigResource.com, All rights reserved