WorkBooks::Opentext help
-
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
-
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
-
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
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
-
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
-
Are you sure the function requires a Unicode string for the filename?
Veni, vidi, abiit domum
-
I was told that automation functions That take variant types in this case VT_BSTR a variant string are always unicode