Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. WorkBooks::OpenText failure

WorkBooks::OpenText failure

Scheduled Pinned Locked Moved COM
questionhelp
2 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    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 .

    G 1 Reply Last reply
    0
    • F ForNow

      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 .

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      ForNow wrote:

      is this correct ?

      no ... you should use

      varfalse.vt = VT_EMPTY

      or

      varfalse.vt = VT_NULL

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups