Loading info using interop

This forum is meant for anything you would like to share with other visitors
Post Reply
ohernandez@sistemas-liasa.com
Posts: 28
Joined: Tue Nov 17, 2015 4:12 pm

Loading info using interop

Post by ohernandez@sistemas-liasa.com »

Hi,
I have a problem importing files from excel, when the cell contents "800 3/4" as a raw material code, the result is loaded as 800.75.
I am using:
VO through Excel.Application.
.NET Interop.
.NET Devexpress worksheet.
Excel ole connection.
All of them import 800.75.
The problem is solved if the user use the apostrophe as a prefix; but we want to keep the process with no modification by the user.

TIA,
Oscar Hernandez
User avatar
robert
Posts: 4478
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Loading info using interop

Post by robert »

Oscar,
Can you show us some code?
Which property of the cell are you reading ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4854
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Loading info using interop

Post by Chris »

I think that's just a "feature" of Excel, it tries to be too "smart" about it. Isn't there a way to query the contents of the cell as text format only?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4478
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Loading info using interop

Post by robert »

Chris,
There is a Formula property that returns the contents of a cell as string

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ohernandez@sistemas-liasa.com
Posts: 28
Joined: Tue Nov 17, 2015 4:12 pm

Loading info using interop

Post by ohernandez@sistemas-liasa.com »

Robert, Chris,
Thanks for the tip, looking for properties like Formula, we found displaytext that did the work.
We will change from a massive way to import into cell by cell using displaytext for the fields that expect string.
Post Reply