Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello !
I'm experiencing an error after a function call returning a Worksheet reference. The function reads like this : Private Function TheSheet(lSheet AS enmSheet) AS Worksheet Select Case lSheet Case enmEmpTable Set TheSheet = ThisWorkbook.Sheets("Employees") Case enmGlobal Set TheSheet = Workbooks(sGlobal).Sheets("Parms") .... End Function Now, in another procedure, I use the following statement to get a specific cell value : vCellVal = TheSheet(lSheet).Cells(lRow, iCol).Value This lines gives an error 1004 : Error defined by application or object. Tracing the code shows that the "TheSheet" function is executing correctly and returns a valid reference to an existing worksheet. iRow and iCol values are valid and the referred cell contains a text value. Any idea ? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error '1004' for looking up date in worksheet | Excel Programming | |||
Nested if returning error 1004 | Excel Programming | |||
Error 1004 in Excel 97 when trying to unprotect a worksheet | Excel Programming | |||
Error 1004 from worksheet activate procedure | Excel Programming | |||
Set worksheet range runtime error 1004 | Excel Programming |