Click here to Skip to main content
16,005,080 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionExcel Automation - Please help ... Pin
GuyM26-Apr-07 1:31
GuyM26-Apr-07 1:31 
AnswerRe: Excel Automation - Please help ... Pin
Nikhil Trivedi26-Apr-07 2:18
Nikhil Trivedi26-Apr-07 2:18 
AnswerRe: Excel Automation - Please help ... Pin
Nikhil Trivedi26-Apr-07 2:21
Nikhil Trivedi26-Apr-07 2:21 
QuestionRe: Excel Automation - Please help ... Pin
GuyM26-Apr-07 2:31
GuyM26-Apr-07 2:31 
AnswerRe: Excel Automation - Please help ... Pin
Nikhil Trivedi26-Apr-07 3:06
Nikhil Trivedi26-Apr-07 3:06 
AnswerRe: Excel Automation - Please help ... Pin
Roger Stoltz26-Apr-07 3:20
Roger Stoltz26-Apr-07 3:20 
GeneralRe: Excel Automation - Please help ... Pin
GuyM26-Apr-07 3:49
GuyM26-Apr-07 3:49 
GeneralRe: Excel Automation - Please help ... Pin
Roger Stoltz26-Apr-07 4:16
Roger Stoltz26-Apr-07 4:16 
Before you continue you have to be aware that Excel deals with containers.
This means that when you launch Excel with CreateDispatch or similar, the next step is usually to get an interface for the WorkBook collection/container called WorkBooks.
The same goes for the WorkSheet objects in the WorkSheets collection/container and so on.

Once you've got hold of the WorkBooks interface, you call WorkBooks::Open(...) in order to open an existing document, a WorkBook. Then you'll get a WorkBook interface to be able to access the document.

When the WorkBook has been opened, you have to choose which WorkSheet you want to use with WorkBook::get_WorkSheets() and later WorkSheets::get_Item(...).

For each cell you want to read or write, you have to select a "Range". The example shows this.

Regarding the fact that you don't want to use a SafeArray to write the data, I think you can give a VARIANT as argument to Range::put_Value() with a single value and the type set to e.g. VT_I4 for a 32-bit integer.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

AnswerRe: Excel Automation - Please help ... Pin
David Crow26-Apr-07 4:06
David Crow26-Apr-07 4:06 
QuestionRe: Excel Automation - Please help ... Pin
GuyM26-Apr-07 4:15
GuyM26-Apr-07 4:15 
AnswerRe: Excel Automation - Please help ... Pin
David Crow26-Apr-07 4:24
David Crow26-Apr-07 4:24 
GeneralRe: Excel Automation - Please help ... Pin
hellogany19-Nov-08 17:38
hellogany19-Nov-08 17:38 
GeneralRe: Excel Automation - Please help ... Pin
David Crow20-Nov-08 3:34
David Crow20-Nov-08 3:34 
GeneralRe: Excel Automation - Please help ... Pin
hellogany23-Nov-08 19:06
hellogany23-Nov-08 19:06 
GeneralRe: Excel Automation - Please help ... Pin
David Crow1-Dec-08 3:50
David Crow1-Dec-08 3:50 
GeneralRe: Excel Automation - Please help ... Pin
thready26-Dec-08 5:30
thready26-Dec-08 5:30 
GeneralRe: Excel Automation - Please help ... Pin
David Crow5-Jan-09 3:55
David Crow5-Jan-09 3:55 
Questionmove to offscreen [modified] Pin
david_joung26-Apr-07 1:15
david_joung26-Apr-07 1:15 
AnswerRe: move to offscreen Pin
Nibu babu thomas26-Apr-07 1:42
Nibu babu thomas26-Apr-07 1:42 
QuestionRe: move to offscreen Pin
David Crow26-Apr-07 4:02
David Crow26-Apr-07 4:02 
AnswerRe: move to offscreen [modified] Pin
david_joung26-Apr-07 6:44
david_joung26-Apr-07 6:44 
QuestionRe: move to offscreen Pin
David Crow26-Apr-07 8:14
David Crow26-Apr-07 8:14 
QuestionRe: Taking more time to create active-x component Pin
praveen kumar agarwal26-Apr-07 0:57
praveen kumar agarwal26-Apr-07 0:57 
QuestionHow to desgin network security project Pin
sharmaarvind26-Apr-07 0:25
sharmaarvind26-Apr-07 0:25 
QuestionHow can i assign character array to cstring object Pin
Mushtaque Nizamani26-Apr-07 0:14
Mushtaque Nizamani26-Apr-07 0:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.