Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to everyone for your insight.
Regards, Krishna "Peter T" wrote: "ThisWorkbook" refers to the Workbook containing the code. Excel VBA supports implicit qualification to the ActiveWorkbook and ActiveSheet etc if not otherwise qualified. If your code workbook is not active you must qualify with a reference to the workbook you are working on, in this case the code workbook. Your code workbook might be referred to in any of these ways. ThisWorkbook Application.Workbooks("myBook.xls") and if it is active - ActiveWorkbook Nothing has changed in this respect from Excel 2003 to 2007 (It is possible to rename "ThisWorkbook") Regards, Peter T "Jayashree Krishna" wrote in message ... Hi, In our VBA code we used Sheets("xxx") to refer to the data in the sheets in the workbook which has the code. This worked well even if we open several other workbooks thru that code. But suddenly, when we upgraded to Excel 2007, this code no longer worked. Then we refered using ThisWorkbook.sheets("xxxx"). Can anybody know why "ThisWorkbook" keyword is not required in Excel 2003 VBA to refer to the sheets in the same workbook, whereas it is required in Excel 2007 to refer to the sheets ? Thanks, Krishna . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
XL2003 - ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeM | Excel Programming | |||
XL2003 - ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule | Excel Programming | |||
ThisWorkbook | Excel Programming | |||
Help with ThisWorkbook | Excel Programming |