Message 1 of 6
iLogic not writing data to Excel correctly

Not applicable
08-02-2018
06:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
so this blob of code is meant to write the flat area of a part to an excel file for the purpose of calculating material cost to make the part at various sizes. the code runs just fine but when I go and look at the actual Excel file, the lengths 12, 24, 36 and 48 are behaving very strangely, they keep getting the same numbers seemingly at random, like 12 and 24 will show the same flat area or 24 and 26 or 36 and 48, 12 and 36, etc. jsut those 4 and none of the others just don't seem to want to write the data properly. help? I have pasted the code here and attached the excel file.
SyntaxEditor Code Snippet
GoExcel.Open("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet1") MessageBox.Show(SheetMetal.FlatExtentsArea, "FlatArea") Select Case Parameter("Table_Length") Case Table_Length >= 12 And Table_Length < 24 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B2") = SheetMetal.FlatExtentsArea Case Table_Length >= 24 And Table_Length < 36 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B3") = SheetMetal.FlatExtentsArea Case Table_Length >= 36 And Table_Length < 48 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B4") = SheetMetal.FlatExtentsArea Case Table_Length >= 48 And Table_Length < 60 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B5") = SheetMetal.FlatExtentsArea Case Table_Length >= 60 And Table_Length < 72 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B6") = SheetMetal.FlatExtentsArea Case Table_Length >= 72 And Table_Length < 84 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B7") = SheetMetal.FlatExtentsArea Case Table_Length >= 84 And Table_Length < 96 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B8") = SheetMetal.FlatExtentsArea Case Table_Length >= 96 And Table_Length < 108 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B9") = SheetMetal.FlatExtentsArea Case Table_Length >= 108 And Table_Length < 120 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B10") = SheetMetal.FlatExtentsArea Case Table_Length >= 120 And Table_Length < 132 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B11") = SheetMetal.FlatExtentsArea Case Table_Length >= 132 And Table_Length < 144 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B12") = SheetMetal.FlatExtentsArea Case Table_Length = 144 GoExcel.CellValue("Catalog Sheet - Dbl Roll Table 1.xlsx", "Sheet3", "B13") = SheetMetal.FlatExtentsArea End Select GoExcel.Save GoExcel.Close MessageBox.Show("FlatArea Updated", "Notice:")