#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel help

Hello,

I have a problem. I am using VC++ to create an Application
object of Excel to do some things in the excel sheet
dynamically.

I want to move a sheet in Excel workbook to the end of all
sheets using the code shown below.
COleVariant
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

sheet = sheets.GetItem(COleVariant((short)1));
sheet.Move(covOptional,COleVariant((short)4));

But i get and exception from excel.

When i try to use

sheet = sheets.GetItem(COleVariant((short)1));
sheet.Move(covOptional,covOptional);

Than it does not give any error but it does nothing that i
want.

Can any one tell me what am i dng wrong and how to do this
rightly...

Also i can add a new sheet but when i try to do it at the
end it gives error.For example when i do this

sheets.Add(covOptional,covOptional,COleVariant((sh ort)
1),covOptional);

It adds a new sheet in the beginning but

when i try to do this

sheets.Add(covOptional,COleVariant((short)3),COleV ariant
((short)1),covOptional);

It gives error!! I need some help on this

Anyone!!

Regards
Ritu
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"