Ok, trying the 7th now... *fingers crossed* ----- Original Message ----- From: "sukii" <lskii@xxxxxxxxxxxx> To: <mso@xxxxxxxxxxxxx> Sent: Tuesday, 10 September, 2002 21:31 Subject: Fw: Excel Macro : Object variable > sorry for the ">", this being the 6th attempt to send this query to the > group. > > > > > > > > > > Dear all, > > > > > > > > > > > > > > I have the following macro, assuming CC is a list of names, and > > > BaseCC > > > > > is > > > > > > a > > > > > > > template where CC is to be duplicated to. > > > > > > > > > > > > > > I have over 60 CC to create based on BaseCC template, however, > > after > > > > > > > creating about halfway through, sometimes lesser, it will stop > and > > > > > display > > > > > > > an error message: > > > > > > > "Run time error : '1004' > > > > > > > Copy method of Worksheets Class failed" > > > > > > > > > > > > > > Below is the code: > > > > > > > > > > > > > > Sub copyCCSheet(CC, BaseCC) > > > > > > > Dim TotalSheets, newSheetNumber As Integer > > > > > > > > > > > > > > 'Duplicate BaseCC worksheet and rename the worksheet to the > > variable > > > > CC > > > > > > > > > > > > > > Worksheets(BaseCC).Copy After:=Worksheets(Worksheets.Count) > > > > > > > Worksheets(Worksheets.Count).Select > > > > > > > ActiveSheet.Name = CC > > > > > > > > > > > > > > End Sub > > > > > > > > > > > > > > What did I do wrong here? Any thoughts much appreciated. > > > > > > > > > > > > > > regards > > > > > > > sukii > > > ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx?Subject=unsubscribe Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles *************************************************************