data from excel to ppt graph

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
Ihave got a problem with transfering data(numbers) from Excel to Graph in
Powerpoint by program code. If I copy range in excel and paste it manually to
data sheet in Powerpoint graph, everything is OK. But if Iwant to do this by
VBA code and copied numbers in the range are not rounded, they are pasted
with all numbers but without decimal point(they are much greater than copied
numbers).
Does anyone have an idea how to transfer numbers correctly?

Thanks
 
You could insert as an Object, then select from Microsoft Excel, Chart, or
Graph, Create from file and navigate to your spreadsheet. that way whatever
you put into your spreadsheet will appear in your PowerPoint presentation

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]


| Hello,
| Ihave got a problem with transfering data(numbers) from Excel to Graph in
| Powerpoint by program code. If I copy range in excel and paste it manually
to
| data sheet in Powerpoint graph, everything is OK. But if Iwant to do this
by
| VBA code and copied numbers in the range are not rounded, they are pasted
| with all numbers but without decimal point(they are much greater than
copied
| numbers).
| Does anyone have an idea how to transfer numbers correctly?
|
| Thanks
 
Hello,
Ihave got a problem with transfering data(numbers) from Excel to Graph in
Powerpoint by program code. If I copy range in excel and paste it manually to
data sheet in Powerpoint graph, everything is OK. But if Iwant to do this by
VBA code and copied numbers in the range are not rounded, they are pasted
with all numbers but without decimal point(they are much greater than copied
numbers).
Does anyone have an idea how to transfer numbers correctly?

There's no way to identify the problem in the code w/o SEEING the code. Please
post an example of what you've got so far.
 
here is part of the code:

ActiveWindow.ViewType = ppViewSlide
ActiveWindow.Selection.SlideRange.Shapes("Graf" & g).Select

Set xlsheet = GetObject("C:\Postbuy.xls", "Excel.Sheet").Sheets("source")
xlsheet.Range("Graf" & g).Copy

ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=2
ActiveWindow.Selection.ShapeRange.OLEFormat.Object.Application.DataSheet.Cells(1, 1).Paste
 
OK, thanks. And could we also have some sample numbers as appear in your
spreadsheet so anyone who's interested can try to duplicate the problem?

By the way, which version of Office is this?
 
for example there is a 3x3cells range called "Graf22" in excel sheet. First
column contains names of rows and first row contains names of columns. other
four cells contain numbers 499,876; 456,3; 162,754; 358. This range is whole
transfered to ppt chart but with the numbers 499.876( the dot is displayed
only for thousands separation, in fact there is the number 499876);
456,3(numbers with exactly one decimal place seems to be transferred
correctly but they alligned to left and are not visible in the chart. it
bercome visible after clicking into a cell); 162.754(same as the first number
in fact it is 162754); 358(correct). I hope it is clear description.

I work with MS office 2003
 
for example there is a 3x3cells range called "Graf22" in excel sheet. First
column contains names of rows and first row contains names of columns. other
four cells contain numbers 499,876; 456,3; 162,754; 358. This range is whole
transfered to ppt chart but with the numbers 499.876( the dot is displayed
only for thousands separation, in fact there is the number 499876);
456,3(numbers with exactly one decimal place seems to be transferred
correctly but they alligned to left and are not visible in the chart. it
bercome visible after clicking into a cell); 162.754(same as the first number
in fact it is 162754); 358(correct). I hope it is clear description.

Have you checked your regional settings in Control Panel?

If it's set to a region that uses a comma rather than a period/full stop as a decimal
separator, that might explain what you're seeing.
 
Yes have allready checked regional settings

Steve Rindsberg said:
Have you checked your regional settings in Control Panel?

If it's set to a region that uses a comma rather than a period/full stop as a decimal
separator, that might explain what you're seeing.



-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
Yes have allready checked regional settings

And they're set to ...?

I can't say what's going on but if you'd like to email me a small sample XLS and a PPT
with chart and sample code (or put the sample code in the XLS if that's how you're
doing the automation) I'll be happy to try it here.

email to steve at-sign pptools dot com
Steve Rindsberg said:
for example there is a 3x3cells range called "Graf22" in excel sheet. First
column contains names of rows and first row contains names of columns. other
four cells contain numbers 499,876; 456,3; 162,754; 358. This range is whole
transfered to ppt chart but with the numbers 499.876( the dot is displayed
only for thousands separation, in fact there is the number 499876);
456,3(numbers with exactly one decimal place seems to be transferred
correctly but they alligned to left and are not visible in the chart. it
bercome visible after clicking into a cell); 162.754(same as the first number
in fact it is 162754); 358(correct). I hope it is clear description.

Have you checked your regional settings in Control Panel?

If it's set to a region that uses a comma rather than a period/full stop as a decimal
separator, that might explain what you're seeing.

I work with MS office 2003

:


OK, thanks. And could we also have some sample numbers as appear in your
spreadsheet so anyone who's interested can try to duplicate the problem?

By the way, which version of Office is this?


here is part of the code:

ActiveWindow.ViewType = ppViewSlide
ActiveWindow.Selection.SlideRange.Shapes("Graf" & g).Select

Set xlsheet = GetObject("C:\Postbuy.xls", "Excel.Sheet").Sheets("source")
xlsheet.Range("Graf" & g).Copy

ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=2
ActiveWindow.Selection.ShapeRange.OLEFormat.Object.Application.DataSheet.Cells(1,
1).Paste

:

 
Back
Top