Solved

To access .XLS by MFC

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 53
haveThree challenge 22 114
NotAlone Challenge 20 80
wordappend challenge 8 150
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

19 Experts available now in Live!

Get 1:1 Help Now