Click here to Skip to main content
15,891,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory Leak Problem Pin
Arun Parthasarathy8-Sep-11 23:06
Arun Parthasarathy8-Sep-11 23:06 
Questionload dll Pin
Benjamin Bruno4-Sep-11 21:01
Benjamin Bruno4-Sep-11 21:01 
QuestionRe: load dll Pin
CPallini4-Sep-11 21:34
mveCPallini4-Sep-11 21:34 
AnswerRe: load dll Pin
Orjan Westin4-Sep-11 23:44
professionalOrjan Westin4-Sep-11 23:44 
AnswerRe: load dll Pin
Eugen Podsypalnikov5-Sep-11 3:24
Eugen Podsypalnikov5-Sep-11 3:24 
Questionmfc100u.lib Pin
columbos149274-Sep-11 2:10
columbos149274-Sep-11 2:10 
AnswerRe: mfc100u.lib Pin
enhzflep4-Sep-11 4:02
enhzflep4-Sep-11 4:02 
QuestionAdd new sheet in Excel using mfc... Pin
spalanivel3-Sep-11 21:42
spalanivel3-Sep-11 21:42 
Hi,
I need to add worksheets(like sheet2,sheet3,...) with the below exising code. Now sheet1 is coming by default and able to write the contents.

Existing Code:
--------------
COleException objEx; // exception object
Application objExcel; // excel application object


// local var
COleVariant vRet;
// row index
long nRow = 1;
// range object
Range objRange;

// create the excel object
objExcel.CreateDispatch( "Excel.Application", &objEx );

// show the application
objExcel.SetVisible( COleVariant(short(FALSE)) );

// get the workbooks object
vRet = objExcel.Workbooks2();

// set the workbooks object
Workbooks objWorkbooks( V_DISPATCH( (LPVARIANT)vRet ) );

// adding the new workbook
vRet = objWorkbooks.Add( COleVariant( (long)xlWorksheet ) );
// set the workbook object
Workbook objWorkbook( V_DISPATCH( (LPVARIANT)vRet ) );

// adding the worksheet
vRet = objWorkbook.Worksheets( COleVariant( (long)1 ) );
// set the worksheet object
Worksheet objWorksheet( V_DISPATCH( (LPVARIANT)vRet ) );

How to add more sheets with the above code? Please help.
I am using below header files;
C#
#include "XL5EN32.H"
#include "excel9.h"
#include "ExcelObject.h"



Thanks,
Pala
AnswerRe: Add new sheet in Excel using mfc... Pin
_Flaviu8-Sep-11 5:37
_Flaviu8-Sep-11 5:37 
QuestionShowNotifyBaloon problem [modified] Pin
_Flaviu3-Sep-11 3:41
_Flaviu3-Sep-11 3:41 
AnswerRe: ShowNotifyBaloon problem Pin
Richard Andrew x643-Sep-11 8:48
professionalRichard Andrew x643-Sep-11 8:48 
GeneralRe: ShowNotifyBaloon problem Pin
_Flaviu3-Sep-11 8:55
_Flaviu3-Sep-11 8:55 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole3-Sep-11 9:20
Chuck O'Toole3-Sep-11 9:20 
GeneralRe: ShowNotifyBaloon problem Pin
Richard Andrew x643-Sep-11 9:27
professionalRichard Andrew x643-Sep-11 9:27 
AnswerRe: ShowNotifyBaloon problem Pin
MicroVirus4-Sep-11 3:12
MicroVirus4-Sep-11 3:12 
GeneralRe: ShowNotifyBaloon problem Pin
_Flaviu5-Sep-11 0:03
_Flaviu5-Sep-11 0:03 
GeneralRe: ShowNotifyBaloon problem Pin
MicroVirus5-Sep-11 11:06
MicroVirus5-Sep-11 11:06 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole5-Sep-11 15:07
Chuck O'Toole5-Sep-11 15:07 
GeneralRe: ShowNotifyBaloon problem Pin
_Flaviu5-Sep-11 19:25
_Flaviu5-Sep-11 19:25 
GeneralRe: ShowNotifyBaloon problem Pin
MicroVirus6-Sep-11 2:39
MicroVirus6-Sep-11 2:39 
GeneralRe: ShowNotifyBaloon problem Pin
MicroVirus6-Sep-11 2:36
MicroVirus6-Sep-11 2:36 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole6-Sep-11 4:03
Chuck O'Toole6-Sep-11 4:03 
GeneralRe: ShowNotifyBaloon problem Pin
_Flaviu6-Sep-11 8:46
_Flaviu6-Sep-11 8:46 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole6-Sep-11 10:16
Chuck O'Toole6-Sep-11 10:16 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole6-Sep-11 10:25
Chuck O'Toole6-Sep-11 10:25 

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.