I keep getting the run time error 1004, but the problem is that the error appears after a finished inserting data in excel (code line: if isnull(rrec!campo) then ...), so I don't know why.
the programs runs well until that line, but the error is related with excel?
Basically, the code is:
Dim AppExcel as variant
Set AppExcel = CreateObject("Excel.application")
Set vXLS = AppExcel.Workbooks.Open(oIcallerForm.IniTemplateDi rectory & "\template5.xls")
vXLS.Sheets("Hoja3").Select
with vXLS
(...)
.Cells(pE, 9).Formula = Trim(rRec!expo_prod_nombre)
.Cells(pE, 10).Formula = "3.- Pedido"
slog = "mensaje" (executes ok!)
if isnull(rrec!campo) then .... (Error 1004)
Why should I do? Thanks
Marce