data from excel to ppt graph

W

wondris

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
 
M

Michael Koerner

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
 
W

wondris

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
 
W

wondris

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
 
W

wondris

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
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top