adding excel worksheets

J

JMGonzalez

Hi all,
I am developing an application to create an excel file with some worksheets
in c++.
When i try to add a new worksheet in a position given by an index, i find a
problem with the add method.
The problem is that I try to insert a new worksheet after the one which
takes the (index-1) position, but the second parameter in the add method
doesn´t work

long index=2;
objSheets.Add(covOpt, COleVariant(index-1), covOpt, covOpt);
objSheet1=objSheets.get_Item(COleVariant(index));

I've also tried to put the worksheet object as the second parameter, but it
doesn't work too:
objSheets.Add(covOpt, objSheets.get_Item(COleVariant(index-1))), 1, covOpt);

Thanks in advance for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top