Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding worksheet at the end of workbook

0 views
Skip to first unread message

Ash Jings

unread,
Sep 9, 2008, 6:33:06 AM9/9/08
to
Hi All,

I am working on excel automation using MFC.

I want to add one worksheet at the end of the current workbook.

Currently I am using Worksheets::Add(Before, after, Count,Type) method.
i am passing optional parameter like this:

COleVariant oOleVarOptional(DISP_E_PARAMNOTFOUND,VT_ERROR);

_Worksheet m_oNewSheet = m_oSheets.Add(oOleVarOptional,oOleVarOptional,
oOleVarOptional, oOleVarOptional)

So it is adding the sheet before the current active sheet.

But i am not getting what to pass for "after" in order to add the sheet at
the end.

Can anybody help me regarding this... ?
--
Thanks
Ash Jings
09/09/08

Ash Jings

unread,
Sep 10, 2008, 7:13:00 AM9/10/08
to
Hey All i found the solution here - http://support.microsoft.com/kb/253501

--
Thanks
Ash Jings

Engineer

unread,
Nov 2, 2008, 11:26:50 AM11/2/08
to
I need to read data from a Excel file (*.htm) using MFC.
I have been searching without luck for an example.
I wanted to try out the code in the sample you found.
I got: error C2065: '_Application' : undeclared identifier
On the first very first line I copied into my program.
What am I doing wrong?

Thanks in advance

"Ash Jings" <jinagar...@gmail.com> wrote in message
news:7E033092-15EA-43C1...@microsoft.com...

Drew

unread,
Nov 3, 2008, 12:31:34 PM11/3/08
to
Did you follow the link under References at the bottom of the article?
http://support.microsoft.com/kb/178749/

Drew

"Engineer" <eba...@aol.com> wrote in message
news:e5rZ5gQP...@TK2MSFTNGP06.phx.gbl...

0 new messages