Error 0x800AC472

Error 0x800AC472

layochim
Enthusiast Enthusiast
180 Views
8 Replies
Message 1 of 9

Error 0x800AC472

layochim
Enthusiast
Enthusiast

I'm still struggling with this iLogic error when writing to an Excel file and pulling a Value from that Excel to a parameter in my model.  Are there any known solutions to 0x800AC472?  My code is below, I've tried using the full file path name and with no success in removing the error.  The rule will successfully pull a value into my parameter the first time then error out after the second.

 

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)
181 Views
8 Replies
Replies (8)
Message 2 of 9

A.Acheson
Mentor
Mentor

Hi @layochim 

It sounds like maybe a parameter doesn't exist or the units are different. Having a try catch statement will help or you can put a message box between each line and determine at which parameter your rule is failing. 

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

layochim
Enthusiast
Enthusiast

I'm not familiar with that technique, since i'm getting more involved with iLogic it'd be a good technique to learn.  Would you be able to assist me on how to add this to the rule?

0 Likes
Message 4 of 9

layochim
Enthusiast
Enthusiast

@A.Acheson I did some research about using GoExcel and find a solution that doesn't throw an error at me.  There was a topic about setting Excel as an "Object", although i'm familiar with what this all technically means but i was able to use their example to my advantage to pull the Price from excel without an error occuring.

Below is the new code that i'm using which doesn't throw an error.

 

	Dim oExcelPath As Object = "C:\Users\Lyle\SCR Solutions\Shared OneDrive - Draftsmen Access\Configurator files\Straight Conveyor Configurator\CAD\Straight Conveyor Pricing Test.xlsx"
'	Dim oExcelPath As String = "Straight Conveyor Pricing.xlsx"
	Dim oExcel As Object = CreateObject("Excel.Application")
	oExcel.Visible = False
	oExcel.DisplayAlerts = False
	Dim oWB As Object = oExcel.Workbooks.Open(oExcelPath)
	Dim oWS As Object = oWB.Sheets(1)
	oWS.Activate


oWS.Cells(9, 2) = BeltWidth
oWS.Cells(10, 2).Value = BeltLength
oWS.Cells(11, 2).Value = Infeed_End
oWS.Cells(12, 2).Value = Discharge_End
oWS.Cells(13, 2).Value = Legs
oWS.Cells(14, 2).Value = Feet
oWS.Cells(15, 2).Value = Belting
'oWS.Cells(16, 2).Value = BeltingType
'oWS.Cells(17, 2).Value = BeltColor
'oWS.Cells(18, 2).Value = Flights
'oWS.Cells(19, 2).Value = Flight_Spacing
oWS.Cells(20, 2).Value = Construction
'oWS.Cells(21, 2).Value = FlangeHeight
oWS.Cells(22, 2).Value = Finish
oWS.Cells(24, 2).Value = Drive_Style
'oWS.Cells(25, 2).Value = Drive_Position
'oWS.Cells(26, 2).Value = MotorVoltage
'oWS.Cells(27, 2).Value = Drive_Speed
oWS.Cells(28, 2).Value = Motor
oWS.Cells(29, 2).Value = Gearbox
oWS.Cells(30, 2).Value = AdjustableGuides
oWS.Cells(31, 2).Value = BeltLifters
oWS.Cells(32, 2).Value = DripPan
'oWS.Cells(33, 2).Value = BeltScraper
oWS.Cells(34, 2).Value = SprayBar
oWS.Cells(35, 2).Value = GearboxGuards

Price = oWS.Cells(6, 2).Value
	oWB.Close (True)
	oExcel.Quit
	oExcel = Nothing
0 Likes
Message 5 of 9

A.Acheson
Mentor
Mentor

I'm glad you got that running. There was likely an error implementing the Go Excel Methods. The objects your now using are just what Go Excel is using behind the scenes. It is hard to identify errors with Go excel because you don't always know where in the process it failed. If you supply the more info tab information instead of the error code there is usually clues in there as to what is going wrong. 

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 9

layochim
Enthusiast
Enthusiast

Yes, that is where I came across this new code, seems "GoExcel" isn't the friendliest way to write to excel and pull information.

With the new code i wrote above, i'm using this with an outside program.  I compress my CAD file with the excel sheet into a ZIP then upload it.

The outside program doesn't like the Filename and Sheetname set as Object and the Filename containing the entire folder path.

 

Is there a way to modify this new code to use the below lines for the filename and sheetname?  I'm unable to make this work.

 

Dim Filename As String = "Straight Conveyor Pricing Test2.xlsx"
Dim SheetName As String = "Conv costing"
0 Likes
Message 7 of 9

A.Acheson
Mentor
Mentor

It sounds like your outside program is the issue here. You can set fullfilepath as well otherwise it is constantly searching the workspace for the excel file. We would need to know how your using the code in the other application to offer further help. 

 

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

layochim
Enthusiast
Enthusiast

You're correct, the outside program was the issue, the developers informed me this morning that their program cannot read iLogic in the way that i intended.  A little disappointing after days of trial and error testing. 

0 Likes
Message 9 of 9

A.Acheson
Mentor
Mentor
Accepted solution

It sounds like you would need an addin, or to display the information in a place that would be accessible by your other program such as a text file or excel. 

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