Click here to Skip to main content
15,914,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Tab Key Pin
Anthony_Yio28-May-04 19:10
Anthony_Yio28-May-04 19:10 
GeneralRe: Tab Key Pin
Ryan Binns29-May-04 3:41
Ryan Binns29-May-04 3:41 
GeneralCreateProcessWithLogonW Pin
cobyjone27-May-04 10:25
cobyjone27-May-04 10:25 
GeneralRe: CreateProcessWithLogonW Pin
Rob Manderson27-May-04 12:41
protectorRob Manderson27-May-04 12:41 
GeneralRe: CreateProcessWithLogonW Pin
cobyjone28-May-04 3:48
cobyjone28-May-04 3:48 
GeneralChanging Size Font and Vertical Scroll Bar Pin
Eversman27-May-04 10:16
Eversman27-May-04 10:16 
GeneralRe: Changing Size Font and Vertical Scroll Bar Pin
gUrM33T27-May-04 15:07
gUrM33T27-May-04 15:07 
GeneralUsing Excel data in VC++ 6.0 Pin
greg8927-May-04 9:31
greg8927-May-04 9:31 
I am trying to access an Excel spreadheet in Visual C++ 6.0. I am using the XL5EN32.OLB library. However I keep getting errors, one of which is:

error C2440: 'type cast' : cannot convert from 'class Sheets' to 'class COleVariant'

I just wanted to be able to pull data out of a spreadsheet and use it in my program. There are problems with Ole. I thought you could define a sheet from the workbook object. However it does not allow me to do this. You have do get sheets from a workbook and a workbook from a file. But I can not do this, the return types don't match. I looked at MSDN article 179706

http://support.microsoft.com/default.aspx?scid=kb;EN-US;179706

It doesn't seem to work that way though. I don't know how they got the return types to match.

COleVariant fn;
CString f;
Application app;
Workbooks books;
Workbook book;
Range pRange;
Sheets sheets;
double Result;
COleVariant
covTrue((short)TRUE),
covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

app.CreateDispatch("Excel.Application");

app.SetVisible(covTrue);

books.Open(fn, covOptional, covOptional, covOptional, covOptional,
covOptional, covOptional, covOptional, covOptional,
covOptional, covOptional, covOptional);

sheets = book.Sheets(COleVariant((short)(1)));
GeneralRe: Using Excel data in VC++ 6.0 Pin
Anthony_Yio27-May-04 17:47
Anthony_Yio27-May-04 17:47 
GeneralRe: Using Excel data in VC++ 6.0 Pin
greg8928-May-04 2:33
greg8928-May-04 2:33 
GeneralRe: Using Excel data in VC++ 6.0 Pin
Anthony_Yio28-May-04 19:00
Anthony_Yio28-May-04 19:00 
GeneralEndModalDialog?? Any Ideas Pin
Cedar Sith27-May-04 7:15
Cedar Sith27-May-04 7:15 
GeneralRe: EndModalDialog?? Any Ideas Pin
Anthony_Yio27-May-04 16:54
Anthony_Yio27-May-04 16:54 
GeneralRe: EndModalDialog?? Any Ideas Pin
Cedar Sith28-May-04 3:01
Cedar Sith28-May-04 3:01 
GeneralRe: EndModalDialog?? Any Ideas Pin
Anthony_Yio28-May-04 19:06
Anthony_Yio28-May-04 19:06 
GeneralRe: EndModalDialog?? Any Ideas Pin
Gary R. Wheeler28-May-04 5:25
Gary R. Wheeler28-May-04 5:25 
GeneralALT+TAB functionality. Pin
baskarchinnu27-May-04 7:06
baskarchinnu27-May-04 7:06 
GeneralRe: ALT+TAB functionality. Pin
Alexander M.,27-May-04 8:34
Alexander M.,27-May-04 8:34 
GeneralRe: ALT+TAB functionality. Pin
baskarchinnu27-May-04 21:23
baskarchinnu27-May-04 21:23 
Questionhow to add a minimize button and maximize button on a dialog? Pin
vividtang27-May-04 6:39
vividtang27-May-04 6:39 
AnswerRe: how to add a minimize button and maximize button on a dialog? Pin
David Crow27-May-04 7:05
David Crow27-May-04 7:05 
AnswerRe: how to add a minimize button and maximize button on a dialog? Pin
Alexander M.,27-May-04 8:41
Alexander M.,27-May-04 8:41 
GeneralRe: how to add a minimize button and maximize button on a dialog? Pin
J.B.27-May-04 17:00
J.B.27-May-04 17:00 
GeneralDDE Server Pin
orcun colak27-May-04 5:20
orcun colak27-May-04 5:20 
GeneralRe: DDE Server Pin
David Crow27-May-04 7:13
David Crow27-May-04 7:13 

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.