Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unqualified references?
Dim NameOfWorkbook as string NameOfWorkbook = ThisWorkbook.Name With ThisWorkbook .WorkSheets.Add after:=.WorkSheets(.WorkSheets.Count) End With -- HTH Bob Phillips "ittac" .(I_Hate_Spam) wrote in message ... Hi NG, probably this question has been asked before, but I couldn't find an answer. Problem: I have a Excel 2003 - VBA-module. In this module I need to create a new sheet. the code looks like this: Dim NameOfWorkbook as string NameOfWorkbook = ThisWorkbook.Name Workbooks(NameOfWorkbook).Sheets.Add after:=Workbooks(NameOfWorkbook).Sheets(Sheets.Cou nt) if I try to add a sheet manually, everything works fine. But I get a Runtime error "-2147319784 (80028018) Method Add of object sheets failed" when I try to add thew sheet using the code. Any help would be greatly appreciated. Regards Bodo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
xpath error? Runtime Error 13 type mismatch | Excel Discussion (Misc queries) | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
naming tab macro error runtime error 1004 | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |