I APOLOGIZE FOR WASTING YOUR TIME.
i BELIEVE I FOUND THE PROBLEM.
Changing the worksheet name without "saving" the excel workbook
does not update the worksheet name that the vba code sees.
If I changed a worksheet name AND saved the workbook, then the
vba code sees the correct worksheet name and the original code worked.
I apologize to you all,
bil
I am getting a Run-time error '9' on line 5 below
Line 2 Dim ptrWrkBk as Workbook
Line 3 Dim ptrWrkSht as Worksheet
Line 4 Set PtrWrkBk = Workbooks(WrkBkName)
Line 5 Set PtrWrkSht = WorkBooks(WrkBkName).Sheets("FieldData")
Code on Line 4 works. I Assume code found workbook.
In Code on line 5 worksheet (sheet1) named "FieldData" exists in the above workbook.
caps and spelling checked
Can anyone see what my problem is?
How do i go about troubleshooting this kind of error?
Also on a separate note:
I use the variable, PtrWrkBk, to mean the pointer to workbook X.
Is this thinking appropriate?
Bookmarks