Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I currently use Office XP on Vista Ultimate
I'm a novice at programing. I have been given a workseeht by my new employer. When I try to add a comment in one area I get this error Runtime Error 438 Object Doesn't Support Property or Method. When I enter debug it's stopped at the "ListRowCount = Selection.ListObject.ListRows.Count" Here is the sub routine. Public Sub CheckJobName(JobName As String) Dim ListRowCount As Integer Dim msgResponse As Variant Sheets("Time Sheet").Select Range("C137").Select ListRowCount = Selection.ListObject.ListRows.Count If FoundName(JobName, Range("C136:C" & ListRowCount)) = True Then msgResponse = MsgBox("There appears to be a job named " & JobName & " already. Do you still wish to add it?", vbExclamation + vbYesNo, "Item Exists?") If msgResponse = vbNo Then Range("A1").Select frmAdd.lblStatus.Caption = "Job not added." Exit Sub Else AddJob JobName End If Else AddJob JobName End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 14, 1:38 pm, "Robert Martin" wrote:
I currently use Office XP on Vista Ultimate I'm a novice at programing. I have been given a workseeht by my new employer. When I try to add a comment in one area I get this error Runtime Error 438 Object Doesn't Support Property or Method. When I enter debug it's stopped at the "ListRowCount = Selection.ListObject.ListRows.Count" Here is the sub routine. Public Sub CheckJobName(JobName As String) Dim ListRowCount As Integer Dim msgResponse As Variant Sheets("Time Sheet").Select Range("C137").Select ListRowCount = Selection.ListObject.ListRows.Count If FoundName(JobName, Range("C136:C" & ListRowCount)) = True Then msgResponse = MsgBox("There appears to be a job named " & JobName & " already. Do you still wish to add it?", vbExclamation + vbYesNo, "Item Exists?") If msgResponse = vbNo Then Range("A1").Select frmAdd.lblStatus.Caption = "Job not added." Exit Sub Else AddJob JobName End If Else AddJob JobName End If End Sub Try: ListRowsCount = Worksheets("Time Sheet").ListObject("name of list object").ListRows.Count |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
xpath error? Runtime Error 13 type mismatch | Excel Discussion (Misc queries) | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |