# All Excel C++ Interop Interfacing Visualisation here

#### Daniel Duffy

##### C++ author, trainer
I, hello world test

#### Attachments

• ExcelHelloWorld.cpp
2.8 KB · Views: 100

#### Daniel Duffy

##### C++ author, trainer
And note incorrect and correct calls. (Check your ExcelDriver.cpp)

C++:
//Excel::_WorksheetPtr sheet = workbook->Worksheets->GetItem("Sheet1");
Excel::_WorksheetPtr sheet = workbook->Worksheets->GetItem(1); //Language-independent

#### alain

##### Older and Wiser
And note incorrect and correct calls. (Check your ExcelDriver.cpp)

C++:
//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 call

#### Daniel Duffy

##### C++ author, trainer
doesn't it make it placement dependent? I don't think that's necessarily an incorrect call
Using "Sheet1" only works with the English version of Excel.

#### alain

##### Older and Wiser
Using "Sheet1" only works with the English version of Excel.
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.

#### Daniel Duffy

##### C++ author, trainer
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.
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.

#### alain

##### Older and Wiser
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.
in that case, change the name. That's what needs to be done.

#### Daniel Duffy

##### C++ author, trainer
in that case, change the name. That's what needs to be done.
What's a good name?

#### alain

##### Older and Wiser
What's a good name?
any name that conveys the content of the worksheet. Sheet1 is definitely not a good one though.

#### Daniel Duffy

##### C++ author, trainer
any name that conveys the content of the worksheet. Sheet1 is definitely not a good one though.
In general, yes. It would be a s/w change control request.
The name occurs in a specific context and using 1 is OK. It is possible to change the name afterwords if need be.

#### ExSan

I am using MS Visual Studio Express 2013, it seems to be not compatible
the file generated by the compiler .... debug\vbe6ext.tli
has this label
// Created by Microsoft (R) C/C++ Compiler Version 12.00.21005.1 (cbedc806). hence the error ?

Last edited:

#### tagoma

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 !

Couldn't this simply be due to admin restrictions?

#### Daniel Duffy

##### C++ author, trainer
Couldn't this simply be due to admin restrictions?
Indeed

1. No file (hint: check file _is_ on disk)
2, Wrong access rights

3. Maybe you have a Express (by definition, Express < Full).
4. file is somewhere else?

Last edited:

#### Daniel Duffy

##### C++ author, trainer
It seems Microsoft has changed some code in their API:

For those students taking QN C++ course it might be worth keeping this in mind (my ExcelDriver)

@APalley
@GONG CHEN

#### ExSan

I don't remember the last time I used MS Excel, Google Sheets are the trend

#### Daniel Duffy

##### C++ author, trainer
I don't remember the last time I used MS Excel, Google Sheets are the trend
Excel is still a standard. Traders use Excel a lot.

Anyways, I built the ExcelDriver in C++ and C# to display FDM output. It's cool.

Replies
15
Views
1K
Replies
30
Views
2K
Replies
0
Views
436
Replies
0
Views
446
Replies
5
Views
902