Solved

To access .XLS by MFC

Posted on 1998-11-16
3
627 Views
Last Modified: 2013-11-20
How can I create and access the .xls(MicrosoftExcel) file
by MFC?
Thank you very much.
0
Comment
Question by:liufeng
3 Comments
 

Expert Comment

by:gspk
ID: 1324806
Use OleAutomation ...
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1324807
MFC does not have any classes that will do this. I would recommend you take a look at the book Microsoft Excel 97 Developer's Kit which has a thorough discussion on the file format.
0
 
LVL 1

Expert Comment

by:V245
ID: 1324808
I'm late a little because I had to check some idea.
If you don't like OleAutomation ( I'm not familiar  with it :-( ) you can choose another way to solve your task. I mean using ODBC. I used it once to solve a similar task. I don't know a 'beautiful' way to create .xls file by means ODBC so I used the following (as far as I recall):
1) I kept a dummy file created by MS Excel and made it's copies whenewer they were necessary.
2) I used CDatabase::ExecuteSQL to make necessary worksheets in the new dummy files.
3) After that I used CRecordset to work with new worksheets.  

MFC doesn't have means to create .xls files but it sure has means to access them. ;-)

I hope it will be usefull.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 52
Include multiple hostnames in this command? 3 55
Separate into files by filename 12 91
how to split multiple lines delimiter : 8 119
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question