I am running an access 97 database and I keep on getting an error: The formula or sheet you want to copy contains the name 'CFY' which already exists on the destination worksheet.
The error occurs two more times with two other names. The part of the program that the problem occurs in is copying a template into another spreadsheet. I originally thought it was the templates that might be causing this so I went into the individual templates and I saw that names defined in the templates had a #Ref error in them so I deleted the name definitions. The error is still occurring at the code that is in blue.I am still getting the error so I was hoping I could get some assistance.
Tom
The error occurs two more times with two other names. The part of the program that the problem occurs in is copying a template into another spreadsheet. I originally thought it was the templates that might be causing this so I went into the individual templates and I saw that names defined in the templates had a #Ref error in them so I deleted the name definitions. The error is still occurring at the code that is in blue.I am still getting the error so I was hoping I could get some assistance.
Tom
Code:
' *** Copy Report to Print Workbook
strWorkbook = "\\salmfilesvr1\public\client services\automate\Rpts\" & (mstrUCI) & "\" & (strCurTmp)
If (rstRpts![typ] <> "DBL") Then
With goXL
.Workbooks.Open FileName:=strWorkbook
.ActiveWorkbook.ConflictResolution = xlLocalSessionChanges
.Sheets(strSheet).Select
.Sheets(strSheet).Name = strNewSheet
With .Sheets(strNewSheet)
.Select
.Range("A1:AZ2500").Copy
.Range("A1:AZ2500").Select
.Range("A1:AZ2500").PasteSpecial Paste:=xlValues
.Cells(1, 1).Select
[Blue] .Copy After:=Workbooks("Print1").Worksheets(3) [/Blue]
End With
' *** Close workbook hoolding original reports
.Workbooks("" & (strCurTmp) & "").Close SaveChanges:=False
End With
End If