Solved

To access .XLS by MFC

Posted on 1998-11-16
3
584 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now