Hi,
I have searched a lot of post but still haven't found an answer, the code I use is as follows:
This doc say:
but how to convert IDispatchPtr to _variant_t ?
Thanks you!
I have searched a lot of post but still haven't found an answer, the code I use is as follows:
HTML Code:
Excel::WorksheetsPtr ws = Worksheets->GetItem(Worksheets->Count); <<-- last worksheet
//Syntax: IDispatchPtr Sheets::Add ( const _variant_t & Before, const _variant_t & After,
// const _variant_t & Count, const _variant_t & Type, long lcid );
Worksheets->Add(vtMissing, ws, <<-- add to last
1, vtMissing, (long)Excel::xlWorksheet));
HTML Code:
After Optional Variant An object that specifies the sheet after which the new sheet is added.
Thanks you!