When I run the following macro in Excel (using VBA) I get the run time error 1004 application defined or object defined error. I get the usual debug message and when I click end I actually get the result I want from the formula - anyone know how to avoid getting the run time error?
thanks!
Sub macro10()
Dim Workbook As String
Dim stDocName As String
Dim CurrMo As Range
Set CurrMo = Worksheets("GROUP RR MAIN ACC").Range("c3")
stDocName = "Q:\Cash\Bank Charges\2009\Chase Downloads\" & CurrMo & "\[grp15131683.xls]"
Worksheets("GROUP RR MAIN ACC").Activate
Range("c7").Activate
'ActiveCell.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R105C8,4,0))=TRUE,0,(VLOOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R105C8,4,0)))"
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R105C8,4,0)))"
Macro2
End Sub