VBA for Excel throws “Object variable or with block variable not set” when there is no Object
问题 In my code, I have declared these variables: Dim Field_Name, Datatype, row As Integer Then, inside a For loop, I have this code: Field_Name = Worksheets(i).UsedRange.Find("Field Name").Column Datatype = Worksheets(i).UsedRange.Find("Datatype").Column row = Worksheets(i).UsedRange.Find("Field Name").row + 1 However, that code throws the "Object variable or with block variable not set" run-time error. According to the API, the Range.Column and Range.row property is a read-only Long. I have