shippey121
Well-known Member
- Joined
- Mar 21, 2006
- Messages
- 1,003
Hi all,
i have a sheet where the users type in summary information, after all data is entered they run a code which creates several new sheets from a template where the user then enters more data,
the problem im having is that the program randomly crashes with error code 1004 on this line
[/code]Sheets.Add After:=Worksheets(shts), Type:="c:\check sheet template.xlt"
i have a sheet where the users type in summary information, after all data is entered they run a code which creates several new sheets from a template where the user then enters more data,
the problem im having is that the program randomly crashes with error code 1004 on this line
[/code]Sheets.Add After:=Worksheets(shts), Type:="c:\check sheet template.xlt"
Code:
for example if the summary sheet contains 20 items the code runs fine and inserts 20 copies of the template, it seems to become a problem when trying to insert 100+ sheets.
i dont think its the pc as ive tried on several,
the loop that inserts the templates is
x = Range("I200").End(xlUp).Row - 3
For nwsheet = 1 To x
shts = Worksheets().Count - 1
Sheets.Add After:=Worksheets(shts), Type:="c:\check sheet template.xlt"
ActiveSheet.Name = "Sheet " & nwsheet
Next nwsheet
sorry for the poor layout, i forgot the code tags