Load/Save between Excel and WxGrid? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
knightmare0
Experienced Solver
Experienced Solver
Posts: 65
Joined: Sat Mar 29, 2008 9:18 pm

Load/Save between Excel and WxGrid?

Post by knightmare0 »

Hi, Im just wondering if there is a way that I can save my wxGrid Data to an Excel format? and is there a way to load Excel Data into wxGrid?

I just need the values in the cells, dont need the formulas.

Also, whats the most efficient way to print the contents of a wxGrid?

Thanks
testalucida
Knows some wx things
Knows some wx things
Posts: 35
Joined: Mon Jan 15, 2007 8:10 pm

Post by testalucida »

Hi,

IMHO there's no direct way. You have to use wxAutomationObject (see the sparse wx documentation)or MS ATL (many examples to be found in the net).
Both rather difficult if you've never done it before.

Maybe there's another way: Excel holds its data in an intern database and it should be possible to request them via SQL. Long ago I did so using Java, but no idea if there's an equivalent in wx / C++.

so long
testalucida
timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post by timg »

If you truly need only the values, you can save your data in a .csv file (comma separated values). Excel can open that.

You can also copy and paste into Excel, but that requires wxAutomation stuff ...
knightmare0
Experienced Solver
Experienced Solver
Posts: 65
Joined: Sat Mar 29, 2008 9:18 pm

Post by knightmare0 »

oh ok thanks timg
Post Reply