How to connect with Excel (via OLE)

This forum is meant for questions and discussions about the X# language and tools
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

How to connect with Excel (via OLE)

Post by Karl-Heinz »

Hi Robert,

you are right !

the "SDK Tools Dir" setting ( see: XIDE "Tools" -> "Preferences" -> "Folders" Tabpage ) pointed to the 2.0 SDK Tools ... Now it points to the 4.6.1 dir and the created excel.dll shows CLR4.

very nice :-)


BTW. The tlbimp.exe throws this warning:

TlbImp : warning TI3002 : Importing a type library into a platform agnostic assembly. This can cause errors if the type library is not truly platform agnostic.

not sure how to interpret this ?


regards
Karl-Heinz
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

How to connect with Excel (via OLE)

Post by Chris »

Hi Karl-Heinz,

I assume it means that it is creating an AnyCPU assembly, but not sure. Maybe it means that if you try to use it under Mono or other platform it will possibly not work.

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

How to connect with Excel (via OLE)

Post by Karl-Heinz »

Hi Chris,

when i fill the "Arguments:" sle with "/machine:x86" the TI3002 warning is gone, and ilspy shows correctly:

// Architecture: x86

instead of:

// Architecture: AnyCPU (64-bit preferred)


when i try "/machine:x64"

TlbImp : error TI2010 : A single valid machine type compatible with the input type library must be specified.

is thrown. Makes sense, as i do have a 32bit office only.


regards
Karl-Heinz
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

How to connect with Excel (via OLE)

Post by Chris »

Very good point!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

How to connect with Excel (via OLE)

Post by FFF »

Motivated by this thread, i had a look on my machine - and i find TEN tlbimp.exe files 5 each in a 64 subnode, one each for "Windows", FX4.0, 4.5.1, 4.6, 4.6.1. Great godness... All of them below program(x86).
What a mess....
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

How to connect with Excel (via OLE)

Post by wriedmann »

Hi Karl,

I have 14 of them, 2 for every version of the SDK (x86 and x64, I think).

Maybe everyone of them creates different code for different versions of the .NET Framework.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

How to connect with Excel (via OLE)

Post by FFF »

Brrr.
@Chris, for now i entered in the "Tools" folder: C:Program Files (x86)Microsoft SDKsWindowsv10.0AbinNETFX 4.6.1 Toolsx64", do you think that's a "good" idea?

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

How to connect with Excel (via OLE)

Post by Chris »

Yeah, I think it should be fine, actually probably all versions >=4.5 should be fine anyway I think. But in case there's any problem, it's easy to change it, this is why I made it a user's choice to select the SDK tools folder he want to use, than having the IDE decide this automatically...
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
softdevo@tiscali.it
Posts: 189
Joined: Wed Sep 30, 2015 1:30 pm

How to connect with Excel (via OLE)

Post by softdevo@tiscali.it »

I use NPOI.dll, it is not necessary that Excel is installed on the machine, until today I have always done everything I need: create Excel files, add sheets, insert data and formulas, set properties of cells etcc.

Danilo
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

How to connect with Excel (via OLE)

Post by Karl-Heinz »

and

4.7
4.7.1
4.7.2

brings 3 x 2 more ;-)
Post Reply