Excel Error with iLogic

Excel Error with iLogic

layochim
Enthusiast Enthusiast
276 Views
5 Replies
Message 1 of 6

Excel Error with iLogic

layochim
Enthusiast
Enthusiast

I'm sure this is a common error, but I'm unable to fix it.  I've got a Pricing rule below that works the first time then when i modify a parameter i get the following.  Anyone have a solution for this?

layochim_0-1754319632543.png

My code is:

Dim Filename As String = "Straight Conveyor Pricing.xlsx"
Dim SheetName As String = "Conv costing"
GoExcel.Open(Filename, SheetName)

GoExcel.CellValue("B9") = BeltWidth
GoExcel.CellValue("B10") = BeltLength
GoExcel.CellValue("B11") = Infeed_End
GoExcel.CellValue("B12") = Discharge_End
GoExcel.CellValue("B13") = Legs
GoExcel.CellValue("B14") = Feet
GoExcel.CellValue("B15") = Belting
GoExcel.CellValue("B16") = BeltingType
GoExcel.CellValue("B17") = BeltColor
GoExcel.CellValue("B18") = Flights
GoExcel.CellValue("B19") = Flight_Spacing
GoExcel.CellValue("B20") = Construction
GoExcel.CellValue("B21") = FlangeHeight
GoExcel.CellValue("B22") = Finish
GoExcel.CellValue("B24") = Drive_Style
GoExcel.CellValue("B25") = Drive_Position
GoExcel.CellValue("B26") = MotorVoltage
GoExcel.CellValue("B27") = Drive_Speed
GoExcel.CellValue("B28") = Motor
GoExcel.CellValue("B29") = Gearbox
GoExcel.CellValue("B30") = AdjustableGuides
GoExcel.CellValue("B31") = BeltLifters
GoExcel.CellValue("B32") = DripPan
GoExcel.CellValue("B33") = BeltScraper
GoExcel.CellValue("B34") = SprayBar
GoExcel.CellValue("B35") = GearboxGuards

Price = GoExcel.CellValue("B6")

GoExcel.Save
GoExcel.Close

 

0 Likes
Accepted solutions (1)
277 Views
5 Replies
Replies (5)
Message 2 of 6

machiel.veldkamp
Collaborator
Collaborator
Accepted solution

Hi! The filename should be the whole path + the filename.xlsx.. so in your case it could be

 

Dim Filename As String = "C:/Folder/Another Folder/Straight Conveyor Pricing.xlsx"

 

Try that and see if that fixes it 🙂

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

___________________________
0 Likes
Message 3 of 6

layochim
Enthusiast
Enthusiast

This seems to be working now.  I'm using this with another outside program.  I upload a ZIP folder containing the model and spreadsheet to this program.  Hopefully it'll fix the pricing in that program as well.  But no error anymore.

0 Likes
Message 4 of 6

layochim
Enthusiast
Enthusiast

@machiel.veldkampthe error came back.

0 Likes
Message 5 of 6

A.Acheson
Mentor
Mentor

Can you share the more info tab? The first tab with the error number doesn't give any information for help unfortunately. Isolate the areas,switch off all code, open the sheet, find one cell, return a cell value, switch back on each line to find a line that doesn't work. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 6 of 6

layochim
Enthusiast
Enthusiast

I believe there was an issue with my Excel sheet, might've been embedded or referencing to another document.  It's unfortunate i don't have a clear solution but i started a new document and the rule is now working correctly.

0 Likes