xcelnovice101
Active Member
- Joined
- Aug 24, 2012
- Messages
- 367
I am receiveing an "Application-defined or object-defined error" message with the following line of code.
All of variables in the code are reading correctly, ie they're referencing the correct folder, file, and sheet name.
I also tried the following version. which yielded the same results.
I tried dropping the "Active" in the "ActiveCell.Formula" section of this code. That message was "Object required"
Code:
ActiveCell.FormulaR1C1 = "=VLOOKUP('""" & LNGPORT & """','" & Folder1 & "[" & MPERFORM & "]" & SHT & "'!C2:C9,COLUMNS('" & Folder1 & "[" & MPERFORM & "]" & SHT & "'!C2:C6),0)/1000"
All of variables in the code are reading correctly, ie they're referencing the correct folder, file, and sheet name.
I also tried the following version. which yielded the same results.
Code:
ActiveCell.Formula = "=VLOOKUP('""" & LNGPORT & """','" & Folder1 & "[" & MPERFORM & "]" & SHT & "'!B7:I1000,COLUMNS('" & Folder1 & "[" & MPERFORM & "]" & SHT & "'!B7:F7),0)/1000"
I tried dropping the "Active" in the "ActiveCell.Formula" section of this code. That message was "Object required"