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 help

WorkBooks::Opentext help

Scheduled Pinned Locked Moved COM
helplearning
6 Posts 2 Posters 19 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 re-posting this as due to continued efforts I have not come up a solution to the bug

    COleVariant
    covTrue((short)TRUE),
    covFalse((short)FALSE),
    covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
    CApplication app;
    CWorkbooks books;
    CWorkbook book;

     app.CreateDispatch(TEXT("Excel.Application"));
     books = app.get\_Workbooks();
     COleVariant myvar;
     myvar.vt = VT\_I4;
     myvar.lVal = NULL;
     COleVariant Orgin((short)2),
    	         StartRow((short)1),
    			 DataType((short)1),
    			 ConsecutiveDelimter((short) FALSE, VT\_BOOL),
    			 TAB((short) FALSE, VT\_BOOL),
    			 Semicolon((short) FALSE, VT\_BOOL),
    			 Comma((short) FALSE, VT\_BOOL),
    			 Space((short) FALSE, VT\_BOOL),
    			 Other((short) FALSE, VT\_BOOL),
    			 OtherChar((short) FALSE, VT\_BOOL),
    			 FieldInfo((short) FALSE, VT\_BOOL),
    			 TextVisualLayout((short) FALSE, VT\_BOOL),
    			 DecimalSeprator((short) FALSE, VT\_BOOL),
    			 ThousandSeprator((short) FALSE, VT\_BOOL),
    			 TrailingMinusNumbers((short) FALSE, VT\_BOOL),
    			 Local((short) FALSE, VT\_BOOL);
    books.OpenText(L"C:\\\\PATH1\\\\PATH2\\\\PATH2\\\\FILE.TXT,
    	                                     Orgin,
    					StartRow,
    					DataType,
    					myvar.lVal,
    					ConsecutiveDelimter,
    					TAB,
    					Semicolon,
    					Comma,
    					Space,
    					Other,
    					OtherChar,
    					FieldInfo,
    					TextVisualLayout,
    					DecimalSeprator,
    					ThousandSeprator,
    					TrailingMinusNumbers,
                        Local);
    

    After executing

    SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
    &dispparams, pvarResult, &excepInfo, &nArgErr);

    sc = 80020009 and execpInfo.scode = 0X800A03EC

    L F 3 Replies Last reply
    0
    • F ForNow

      Hi I am re-posting this as due to continued efforts I have not come up a solution to the bug

      COleVariant
      covTrue((short)TRUE),
      covFalse((short)FALSE),
      covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
      CApplication app;
      CWorkbooks books;
      CWorkbook book;

       app.CreateDispatch(TEXT("Excel.Application"));
       books = app.get\_Workbooks();
       COleVariant myvar;
       myvar.vt = VT\_I4;
       myvar.lVal = NULL;
       COleVariant Orgin((short)2),
      	         StartRow((short)1),
      			 DataType((short)1),
      			 ConsecutiveDelimter((short) FALSE, VT\_BOOL),
      			 TAB((short) FALSE, VT\_BOOL),
      			 Semicolon((short) FALSE, VT\_BOOL),
      			 Comma((short) FALSE, VT\_BOOL),
      			 Space((short) FALSE, VT\_BOOL),
      			 Other((short) FALSE, VT\_BOOL),
      			 OtherChar((short) FALSE, VT\_BOOL),
      			 FieldInfo((short) FALSE, VT\_BOOL),
      			 TextVisualLayout((short) FALSE, VT\_BOOL),
      			 DecimalSeprator((short) FALSE, VT\_BOOL),
      			 ThousandSeprator((short) FALSE, VT\_BOOL),
      			 TrailingMinusNumbers((short) FALSE, VT\_BOOL),
      			 Local((short) FALSE, VT\_BOOL);
      books.OpenText(L"C:\\\\PATH1\\\\PATH2\\\\PATH2\\\\FILE.TXT,
      	                                     Orgin,
      					StartRow,
      					DataType,
      					myvar.lVal,
      					ConsecutiveDelimter,
      					TAB,
      					Semicolon,
      					Comma,
      					Space,
      					Other,
      					OtherChar,
      					FieldInfo,
      					TextVisualLayout,
      					DecimalSeprator,
      					ThousandSeprator,
      					TrailingMinusNumbers,
                          Local);
      

      After executing

      SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
      &dispparams, pvarResult, &excepInfo, &nArgErr);

      sc = 80020009 and execpInfo.scode = 0X800A03EC

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Not enough information here to even begin to guess what you are doing.

      Veni, vidi, abiit domum

      1 Reply Last reply
      0
      • F ForNow

        Hi I am re-posting this as due to continued efforts I have not come up a solution to the bug

        COleVariant
        covTrue((short)TRUE),
        covFalse((short)FALSE),
        covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
        CApplication app;
        CWorkbooks books;
        CWorkbook book;

         app.CreateDispatch(TEXT("Excel.Application"));
         books = app.get\_Workbooks();
         COleVariant myvar;
         myvar.vt = VT\_I4;
         myvar.lVal = NULL;
         COleVariant Orgin((short)2),
        	         StartRow((short)1),
        			 DataType((short)1),
        			 ConsecutiveDelimter((short) FALSE, VT\_BOOL),
        			 TAB((short) FALSE, VT\_BOOL),
        			 Semicolon((short) FALSE, VT\_BOOL),
        			 Comma((short) FALSE, VT\_BOOL),
        			 Space((short) FALSE, VT\_BOOL),
        			 Other((short) FALSE, VT\_BOOL),
        			 OtherChar((short) FALSE, VT\_BOOL),
        			 FieldInfo((short) FALSE, VT\_BOOL),
        			 TextVisualLayout((short) FALSE, VT\_BOOL),
        			 DecimalSeprator((short) FALSE, VT\_BOOL),
        			 ThousandSeprator((short) FALSE, VT\_BOOL),
        			 TrailingMinusNumbers((short) FALSE, VT\_BOOL),
        			 Local((short) FALSE, VT\_BOOL);
        books.OpenText(L"C:\\\\PATH1\\\\PATH2\\\\PATH2\\\\FILE.TXT,
        	                                     Orgin,
        					StartRow,
        					DataType,
        					myvar.lVal,
        					ConsecutiveDelimter,
        					TAB,
        					Semicolon,
        					Comma,
        					Space,
        					Other,
        					OtherChar,
        					FieldInfo,
        					TextVisualLayout,
        					DecimalSeprator,
        					ThousandSeprator,
        					TrailingMinusNumbers,
                            Local);
        

        After executing

        SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
        &dispparams, pvarResult, &excepInfo, &nArgErr);

        sc = 80020009 and execpInfo.scode = 0X800A03EC

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #3

        I am trying to load the .txt file specified in the first parameter of the OpenText API And for some reason I get the feeling the source of the error Is its not finding the file I tried various variations on the file name as just specifying the file and having it in a directory That's in the path variable but I still get the same error Thanks

        1 Reply Last reply
        0
        • F ForNow

          Hi I am re-posting this as due to continued efforts I have not come up a solution to the bug

          COleVariant
          covTrue((short)TRUE),
          covFalse((short)FALSE),
          covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
          CApplication app;
          CWorkbooks books;
          CWorkbook book;

           app.CreateDispatch(TEXT("Excel.Application"));
           books = app.get\_Workbooks();
           COleVariant myvar;
           myvar.vt = VT\_I4;
           myvar.lVal = NULL;
           COleVariant Orgin((short)2),
          	         StartRow((short)1),
          			 DataType((short)1),
          			 ConsecutiveDelimter((short) FALSE, VT\_BOOL),
          			 TAB((short) FALSE, VT\_BOOL),
          			 Semicolon((short) FALSE, VT\_BOOL),
          			 Comma((short) FALSE, VT\_BOOL),
          			 Space((short) FALSE, VT\_BOOL),
          			 Other((short) FALSE, VT\_BOOL),
          			 OtherChar((short) FALSE, VT\_BOOL),
          			 FieldInfo((short) FALSE, VT\_BOOL),
          			 TextVisualLayout((short) FALSE, VT\_BOOL),
          			 DecimalSeprator((short) FALSE, VT\_BOOL),
          			 ThousandSeprator((short) FALSE, VT\_BOOL),
          			 TrailingMinusNumbers((short) FALSE, VT\_BOOL),
          			 Local((short) FALSE, VT\_BOOL);
          books.OpenText(L"C:\\\\PATH1\\\\PATH2\\\\PATH2\\\\FILE.TXT,
          	                                     Orgin,
          					StartRow,
          					DataType,
          					myvar.lVal,
          					ConsecutiveDelimter,
          					TAB,
          					Semicolon,
          					Comma,
          					Space,
          					Other,
          					OtherChar,
          					FieldInfo,
          					TextVisualLayout,
          					DecimalSeprator,
          					ThousandSeprator,
          					TrailingMinusNumbers,
                              Local);
          

          After executing

          SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags,
          &dispparams, pvarResult, &excepInfo, &nArgErr);

          sc = 80020009 and execpInfo.scode = 0X800A03EC

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Are you sure the function requires a Unicode string for the filename?

          Veni, vidi, abiit domum

          F 1 Reply Last reply
          0
          • L Lost User

            Are you sure the function requires a Unicode string for the filename?

            Veni, vidi, abiit domum

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            I was told that automation functions That take variant types in this case VT_BSTR a variant string are always unicode

            L 1 Reply Last reply
            0
            • F ForNow

              I was told that automation functions That take variant types in this case VT_BSTR a variant string are always unicode

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I have not managed to find a decent explanation for either of the error codes you received. All I can suggest is that you test with a Unicode and ASCII version of the string, and be sure that the path to the file is correct.

              Veni, vidi, abiit domum

              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