xsharp.eu • Loading info using interop
Page 1 of 1

Loading info using interop

Posted: Fri Aug 30, 2019 10:32 pm
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

Loading info using interop

Posted: Sat Aug 31, 2019 8:29 am
by robert
Oscar,
Can you show us some code?
Which property of the cell are you reading ?

Robert

Loading info using interop

Posted: Sat Aug 31, 2019 8:38 am
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?

Loading info using interop

Posted: Sat Aug 31, 2019 8:39 am
by robert
Chris,
There is a Formula property that returns the contents of a cell as string

Robert

Loading info using interop

Posted: Sat Aug 31, 2019 3:38 pm
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.