Problem with getting Excel Data (GoExcel.Open)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I´m having a couple of problems with getting data correctly from an Excel Sheet. I´m using the Excel Sheet to get Data for the Stock Number based on geometry.
First time the Excel File get´s opened it always cannot find the first sheet. I´m using a german Version and Sheet1 is Tabelle1 in german.
It always searches for sheet1 the first time the script runs on a new derived assembly. The second time (on second part) it correctly finds Tabelle1 and reads the correct value.
I´m out of ideas why this is happening.
Here is the code I´m using:
[code]
myXLS = "K:\IdentNr.xls"
GoExcel.Open(myXLS)
i = GoExcel.FindRow(myXLS, "Tabelle1", "Stärke", "=", Stärke, "Material", "=", iProperties.Material)
IdentNr = GoExcel.CurrentRowValue("IdentNr")
iProperties.Value("Custom", "IdentNr") = IdentNr
[\code]
And there is another issue which I have solved already but still gives me a bit of a headache. When the userdefined property IdentNr gets written into the part it always defaults to a numerical value, which means that I always get a comma at the end of the Stock Number.
Only when I define IdentNr like this:
Dim IdentNr As String
the format is correctly set to Text.
I expected that when you read a value from an Excel Cell that the Format of the Cell gives the format of the user defined property. Is that not correct?
Cheers