Thread: Weird error
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Weird error

Hi
Worksheet and workbook are not good variable names as they are objects
in Excel VBA. If you want to create a new worksheet in your workbook
try:

Set myWorkSheet = myWorkBook.WorkSheets.Add

where you might have done
Set myWorkBook = Application.Workbooks("Tester")
or
Set myWorkBook = ActiveWorkBook

look at the parameters in the Add method for control over where it goes
in the workbook.

regards
Paul