Click here to Skip to main content
11,437,397 members (34,570 online)
   

COM

 
QuestionTLDR, simpler version Pin
T800G18-Apr-13 11:23
memberT800G18-Apr-13 11:23 
QuestionHow to get the path [modified] Pin
sarfaraznawaz27-Feb-13 20:44
membersarfaraznawaz27-Feb-13 20:44 
AnswerRe: How to get the path Pin
Richard MacCutchan27-Feb-13 23:04
mvpRichard MacCutchan27-Feb-13 23:04 
GeneralRe: How to get the path Pin
sarfaraznawaz27-Feb-13 23:27
membersarfaraznawaz27-Feb-13 23:27 
GeneralRe: How to get the path Pin
Richard MacCutchan27-Feb-13 23:46
mvpRichard MacCutchan27-Feb-13 23:46 
GeneralRe: How to get the path Pin
sarfaraznawaz28-Feb-13 0:27
membersarfaraznawaz28-Feb-13 0:27 
GeneralRe: How to get the path Pin
Richard MacCutchan28-Feb-13 0:28
mvpRichard MacCutchan28-Feb-13 0:28 
QuestionWorkBooks::OpenText file not loading Pin
ForNow12-Feb-13 11:38
memberForNow12-Feb-13 11:38 
Hi,

I have the following code sequences whose pourpose is to display a .txt file in a Excel Spreadsheet, however the .txt file is not being loaded after I execute workbooks.opentext
a workbook is loaded but there are no sheets displayed let alone text
I get good return codes from IDispatch->invoke and good return codes in excpInfo

I have changed the file name to a bogous name and the same thing happens


  app.CreateDispatch("Excel.Application");  // this works my code I usally check AX register    
  Workbooks objBooks(app.Workbooks());       // while testing
 
 Workbooks objBooks = app.GetWorkbooks();
 
    COleVariant FilenameOpen(File), 
        FilenameSave(XlsFile), 
        Origin((short)2), // xlWindows 
        StartRow((short)1), 
        DataType((short)1), // xlDelimited 
        TextQualifier((short)1), // xlDoubleQuote 
        ConsecutiveDelimiter((long)FALSE, VT_BOOL), 
        Tab((long)FALSE, VT_BOOL), 
        Semicolon((long)TRUE, VT_BOOL),
		Comma((long)FALSE, VT_BOOL), 
		Space((long)FALSE, VT_BOOL),
		Other((long)FALSE, VT_BOOL),
		Otherchar((long)FALSE,VT_BOOL),
		Fieldinfo((long) FALSE, VT_BOOL),
		TextVisualLayout((long)FALSE, VT_BOOL),
		DecimalSeperator((long) FALSE, VT_BOOL),
		ThousandSepartor((long) FALSE, VT_BOOL),
		TrailingMinusNumbers((long) FALSE, VT_BOOL),
		Local((long) FALSE, VT_BOOL),
                  Fileformat((short)33), // xlExcel4 
                  Save((long)FALSE, VT_BOOL);
 
COleSafeArray saRet;
DWORD numElements[2];
numElements[0] = 2;
numElements[1] = 2;
saRet.Create(VT_I4,2,numElements);
long index[2];
long val;
index[0]=0;
index[1]=0;
val = 1;
saRet.PutElement(index,&val);
index[0] = 1;
index[1] = 0;
val = 2;
index[0] = 1;
index[1] = 1;
val = 9;
 
objBooks.OpenText((LPCTSTR)"C:\\Program Files\\Microsoft VIsual Studio\\MyProjects\\I46023\\I46023.txt", Origin, COleVariant((long)1),COleVariant((long)1),  
             1, 
			 ConsecutiveDelimiter, Tab, Semicolon,
 			 Comma,Space,Other,Otherchar,saRet,TextVisualLayout,
 			 DecimalSeperator,ThousandSepartor,TrailingMinusNumbers,
 			 Local);
			
 app.SetVisible(true);
  app.SetUserControl(TRUE);
 
       















AnswerRe: WorkBooks::OpenText file not loading Pin
Richard MacCutchan27-Feb-13 23:09
mvpRichard MacCutchan27-Feb-13 23:09 
GeneralRe: WorkBooks::OpenText file not loading Pin
ForNow28-Feb-13 9:07
memberForNow28-Feb-13 9:07 
GeneralRe: WorkBooks::OpenText file not loading Pin
Richard MacCutchan28-Feb-13 22:47
mvpRichard MacCutchan28-Feb-13 22:47 
GeneralRe: WorkBooks::OpenText file not loading Pin
ForNow1-Mar-13 9:20
memberForNow1-Mar-13 9:20 
GeneralRe: WorkBooks::OpenText file not loading Pin
Richard MacCutchan2-Mar-13 0:46
mvpRichard MacCutchan2-Mar-13 0:46 
QuestionDISP_E_EXCEPTION & excepinfo->scode 800A03EC from WorkBooks::OpenText Pin
ForNow6-Feb-13 13:26
memberForNow6-Feb-13 13:26 
AnswerRe: DISP_E_EXCEPTION & excepinfo->scode 800A03EC from WorkBooks::OpenText Pin
Richard MacCutchan6-Feb-13 23:34
mvpRichard MacCutchan6-Feb-13 23:34 
QuestionWorkBooks::OpenText failure Pin
ForNow5-Feb-13 12:25
memberForNow5-Feb-13 12:25 
AnswerRe: WorkBooks::OpenText failure Pin
Garth J Lancaster5-Feb-13 15:47
memberGarth J Lancaster5-Feb-13 15:47 
QuestionDISP_E_UNKNOWNNAME from GetIDsOfNames Pin
ForNow29-Jan-13 15:04
memberForNow29-Jan-13 15:04 
AnswerRe: DISP_E_UNKNOWNNAME from GetIDsOfNames Pin
Richard MacCutchan29-Jan-13 22:16
mvpRichard MacCutchan29-Jan-13 22:16 
GeneralRe: DISP_E_UNKNOWNNAME from GetIDsOfNames Pin
ForNow30-Jan-13 9:36
memberForNow30-Jan-13 9:36 
GeneralRe: DISP_E_UNKNOWNNAME from GetIDsOfNames Pin
Richard MacCutchan30-Jan-13 10:35
mvpRichard MacCutchan30-Jan-13 10:35 
GeneralRe: DISP_E_UNKNOWNNAME from GetIDsOfNames Pin
Richard MacCutchan30-Jan-13 10:39
mvpRichard MacCutchan30-Jan-13 10:39 
GeneralRe: DISP_E_UNKNOWNNAME from GetIDsOfNames Pin
ForNow30-Jan-13 10:58
memberForNow30-Jan-13 10:58 
GeneralRe: DISP_E_UNKNOWNNAME from GetIDsOfNames Pin
Richard MacCutchan30-Jan-13 11:10
mvpRichard MacCutchan30-Jan-13 11:10 
GeneralFound the Answer PLease Read Pin
ForNow30-Jan-13 11:34
memberForNow30-Jan-13 11:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.150428.2 | Last Updated 5 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid