Efficiently populating MSGraph datasheet

J

Jason Frank

We are trying to find a way to load data more efficiently into a MS Graph
chart object's DataSheet using the C# MSGraph API. The chart we are
populating lives in a PowerPoint slide. There are several ways that we have
found that are supported, but would like to know if there are any different
approaches as none of these feels like the right approach.


1) Load the data cell by cell - this approach works, but is incredibly
slow when the data sheet contains a large amount of data. E.g. 100 rows x 10
columns. Each call to set a Cell's data is an expensive call to the Graph
API.

2) Paste from the Clipboard - I would prefer NOT to Copy a specific
format to the Clipboard and then Paste it into the Datasheet.

3) Also, there is the option of Importing a file (.txt, .csv,
..xls, .), where we would write the data to a file and then import this into
the Chart. I am leaning towards this option and am able to import an Excel
file, but am having difficulty importing a .txt file. When I try to import a
..txt file the application just hangs and does not return. I tried this in
VBA in PPT as well and have the same problem. I am, however, able to import
this text file through the PowerPoint UI itself and am presented with a
wizard to specify several options - delimiter or fixed width, delimiter,
column data format, etc.


So, I have two questions:

1.) Does anyone know what is causing the .txt FileImport to hang or how
to resolve this?


2.) Is anyone familiar with any way to use an array to set the Chart's
Datasheet 1 row at a time, or a double array to set the entire grid at once?
Excel allows this but am cannot find any way to do this in PPT / MS Graph.

Thanks,

Jason
 
P

Peter Huang [MSFT]

Hi

As you said, in the UI operation, the Wizard will ask you which delimiter
to use. But in the VBA, the FileImport did not have the argument for us to
do that.
So it is recommended to use xls file.

Because Graph has the different implement from Excel, so it has its own
object modal, so far to transfer data into datasheet, we have do it cell by
cell.

So far for performance concern, if you do want the clipboard approach, I
think use the xls file is an alternative method.
Also where did you get the large datasource, if it is a database, we can
use ADO to populate a Excel file with Database data.
How To Transfer Data from ADO Data Source to Excel with ADO (295646)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;295646

And then you can import the xls file.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Randall Arnold

Just in case you ever keep tabs on this old request <g>, have you tried
driving the Graph object from a spreadsheet or Access table/query? I'm doing
that with certain Powerpoint presentations and it works perfectly.
 

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