wxGrid and Excel

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
Eric Bonvins
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Mar 02, 2005 8:48 pm
Location: Paris, France

wxGrid and Excel

Post by Eric Bonvins » Tue Mar 08, 2005 10:02 pm

How can I save a wxGrid in a "real xls" file (not a "csv" one) ?
And how can I open a "xls" file using a wxGrid ?

Is there any code about this ?

Thanks a lot ;)
Windows XP SP2
Dev-C++ 4.9.9.2
wxWidgets 2.4.2

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Tue Mar 08, 2005 11:50 pm

Well, I guess you'll have to find some document describing the structure of a .xls file, and then provide some parsing function that will bridge between reading the file and writing the information to your wxGrid. For the structure of xls, you could probably search it up in google or, even check if OpenOffice has some developer documents describing it. :!:

Ryan Wilcox
I live to help wx-kind
I live to help wx-kind
Posts: 194
Joined: Mon Aug 30, 2004 1:26 pm
Location: PA, USA
Contact:

Post by Ryan Wilcox » Wed Mar 09, 2005 3:59 am

There was a discussion on the wx-users list a few months ago on this topic, maybe you can pull useful information from there

HTH,
_Ryan Wilcox
Ryan Wilcox
Wilcox Development Solutions
http://www.wilcoxd.com

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Wed Mar 09, 2005 7:37 am

If you are on windows, you can use wxAutomationObject with the excel (office in general) automation-interface.

In fact, the automation interface (function names) is really near the visual basic for excel.
You can found all the excel automation API on the integrate visual basic editor of excel (on xp I found it menu:tools/macro/Visual basic editor) and on the visual basic editor menu:show/object explorer (I dont know its name in english, I have the french version) and a tree with all properties and method is display.

On http://www.wxwidgets.org/manuals/2.5.4/ ... tionobject , you have little example on using automation on excel.

Good luck ;)

Eric Bonvins
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Mar 02, 2005 8:48 pm
Location: Paris, France

Post by Eric Bonvins » Wed Mar 09, 2005 1:36 pm

Thanks.
Windows XP SP2
Dev-C++ 4.9.9.2
wxWidgets 2.4.2

vsp
Knows some wx things
Knows some wx things
Posts: 35
Joined: Mon Feb 21, 2005 12:52 pm

Post by vsp » Thu Mar 24, 2005 9:43 am

I feel it is better to go ahead writng a parser if you want to have a clean implementation which will take a lot of time.

But just you want to change some properties of xl sheet wxAutomation will be right choice.

HeReSY
Earned some good credits
Earned some good credits
Posts: 120
Joined: Fri Sep 17, 2004 8:58 pm
Location: Germany

Post by HeReSY » Sun Mar 27, 2005 11:46 am

There is agood side in the web, where you can find a lot of information about the different formats.

http://www.wotsit.org

HeReSY

Post Reply