Daniel Duffy
C++ author, trainer
- Joined
- 10/4/07
- Messages
- 10,335
- Points
- 648
//Excel::_WorksheetPtr sheet = workbook->Worksheets->GetItem("Sheet1");
Excel::_WorksheetPtr sheet = workbook->Worksheets->GetItem(1); //Language-independent
doesn't it make it placement dependent? I don't think that's necessarily an incorrect callAnd note incorrect and correct calls. (Check your ExcelDriver.cpp)
Code://Excel::_WorksheetPtr sheet = workbook->Worksheets->GetItem("Sheet1"); Excel::_WorksheetPtr sheet = workbook->Worksheets->GetItem(1); //Language-independent
Using "Sheet1" only works with the English version of Excel.doesn't it make it placement dependent? I don't think that's necessarily an incorrect call
I don't disagree with that. However, using the ordinal number assumes you are looking at the first sheet. If a new sheet is inserted the code stops working. I rather use the name since Sheet1 is going to change to something meaningful (you don't plan to keep Sheet1, correct?) and you can use whatever name you picked going forward.Using "Sheet1" only works with the English version of Excel.
Well, I would like to but "Sheet1" will crash non-English versions.I don't disagree with that. However, using the ordinal number assumes you are looking at the first sheet. If a new sheet is inserted the code stops working. I rather use the name since Sheet1 is going to change to something meaningful (you don't plan to keep Sheet1, correct?) and you can use whatever name you picked going forward.
If you keep the name of the worksheet you are interacting with as Sheet1, Sheet2, etc, we are ready for a more meaningful discussion.
in that case, change the name. That's what needs to be done.Well, I would like to but "Sheet1" will crash non-English versions.
The name is not so important for visualisation at the moment, the latter being the objective in the C++ course.
What's a good name?in that case, change the name. That's what needs to be done.
any name that conveys the content of the worksheet. Sheet1 is definitely not a good one though.What's a good name?
In general, yes. It would be a s/w change control request.any name that conveys the content of the worksheet. Sheet1 is definitely not a good one though.
compiler says
fatal error C1083: Cannot open type library file: 'C:\Program Files(x86)\Common Files\microsoft shared\OFFICE14\mso.dll': No such file or directory
but it is there !
IndeedCouldn't this simply be due to admin restrictions?
Excel is still a standard. Traders use Excel a lot.I don't remember the last time I used MS Excel, Google Sheets are the trend