LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Method Add of object Sheet failed


code example:

Private Sub CommandButton1_Click()
Dim filename As String
Dim i As Integer

Sheets.Add Type:="C:\MyBook.xls"
Sheets(1).Select
Sheets(1).Move
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:="C:\MyBook.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
Application.DisplayAlerts = False
Workbooks(1).Activate
Sheets(1).Select

End Sub

--When I press the button 7 times VB Show Error message:
--Run-time error 1004:
--Method Add of object Sheet failed

Please help. WHY DO THIS PROBLEM

--
JonMits
-----------------------------------------------------------------------
JonMitsu's Profile: http://www.excelforum.com/member.php...fo&userid=3618
View this thread: http://www.excelforum.com/showthread.php?threadid=55962

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Add of object Validation Failed - please help Shokie New Users to Excel 1 July 10th 09 01:34 PM
Method Add of object Validation Failed - please help Shokie Excel Worksheet Functions 1 July 10th 09 01:33 PM
Method 'Add' of object 'CommandBarControls' failed LAF Excel Discussion (Misc queries) 0 September 12th 05 02:02 PM
method of axes of object failed Papa Jonah Excel Programming 2 October 20th 04 04:59 PM
Method ~ of Object ~ Failed. Joan Excel Programming 5 August 26th 03 08:13 PM


All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"