Thread
:
Method Add of object Sheet failed
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Method Add of object Sheet failed
Sheets.Add Type:="Worksheet"
It might help for you to tell us exactly what you are trying to do.
--
Don Guillett
SalesAid Software
"JonMitsu" wrote in
message ...
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?
--
JonMitsu
------------------------------------------------------------------------
JonMitsu's Profile:
http://www.excelforum.com/member.php...o&userid=36188
View this thread:
http://www.excelforum.com/showthread...hreadid=559622
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett