Hi Guys,
I was wondering whether anyone had come across the above issue before?
I've got a database that basically writes the data stored in the various tables/queries to an Excel template using VB code. However when I run this I'm getting an error message of:
"Run-time error "50290": Application-defined or object-defined error"
appearing on various statements where I'm writing to fields in Excel, for example it randomly stops on any of these statements:
Code:
If ((IsNull(myRec.Fields("OOS")) Or myRec.Fields("OOS") = False)) Then
xlSht.Cells(rowNo, "B").FormulaR1C1 = myRec.Fields("Inc No") 'Inc
xlSht.Cells(rowNo, "C").FormulaR1C1 = myRec.Fields("App") 'App
xlSht.Cells(rowNo, "D").FormulaR1C1 = myRec.Fields("First") 'First
xlSht.Cells(rowNo, "E").FormulaR1C1 = myRec.Fields("Closing") ' Closing
It's strange as I can go into debug mode and press the run button and it'll skip past and complete the rest of the script.
So effectively I'm getting the results I want I'm just getting these annoying error messages when I run it.
Does anyone have any ideas?
Thanks