Click here to Skip to main content
12,078,090 members (46,370 online)
   

COM

 
QuestionWorkBooks::OpenText failure Pin
ForNow5-Feb-13 12:25
memberForNow5-Feb-13 12:25 
Hi,

I am get an assert error when calling WorkBooks::OpenText

I traced it down the code to dispatch->invoke and the return code from that

was 0x80020008 DISP_E_BADVARTYPE One of the arguments in rgvarg is not a valid variant type.

I had a VARIANT for all my arguments besides the 5th which is a long

My question is then the following almost all the paramters are optional

besdides the first which is the filename

I assumed optional was a NULL so.

I coded the following for NULL

VARIANT varfalse.

varfalse.intVal = 0;
varfalse.vt = VT_INT;

is this correct ?

thanks

.
AnswerRe: WorkBooks::OpenText failure Pin
Garth J Lancaster5-Feb-13 15:47
memberGarth J Lancaster5-Feb-13 15:47 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160212.1 | Last Updated 29 Dec 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid