Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel runtime 1004
I am putting a front end on an excel worksheet. I got the basics input
and I am testing it with one field. I get a runtime error of 1004. Application-defined or Object-define error. Here is my code: Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As New Worksheet Set ws = Worksheets("MayerInsInfo") 'find the first row in the sheet iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(2, 0) 'copy the data to the database ws.Cells(iRow, 2) = Me.txtFName.Value <-- highlights with error. End Sub Any suggestions would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel runtime 1004
Hi lmnorms1,
Try changing: iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(2, 0) to iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(2, 0).Row --- Regards, Norman wrote in message ps.com... I am putting a front end on an excel worksheet. I got the basics input and I am testing it with one field. I get a runtime error of 1004. Application-defined or Object-define error. Here is my code: Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As New Worksheet Set ws = Worksheets("MayerInsInfo") 'find the first row in the sheet iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(2, 0) 'copy the data to the database ws.Cells(iRow, 2) = Me.txtFName.Value <-- highlights with error. End Sub Any suggestions would be greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel runtime 1004
Thank you that worked.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel chart export error runtime 1004 | Charts and Charting in Excel | |||
excel chart export error runtime 1004 | Excel Programming | |||
excel 2002 runtime error 1004 | Excel Programming | |||
Excel 2002 Data Forms runtime error 1004 | Excel Programming |