?
Solved

To access .XLS by MFC

Posted on 1998-11-16
3
Medium Priority
?
641 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

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

Accepted Solution

by:
Tommy Hui earned 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

771 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