View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Script fails in Excel was okay before.

Jonah,

My guess is that this line is failing because there is no sheet by that name...
Sheets("Lesson Template (2)").Name = FullName
Excel may be naming it using a higher number.
You could work around that with...

Set shtCopy = Sheets("Lesson Template").Copy(After:=Sheets(2))
shtCopy.Name = FullName

I strongly recommend that you enter "Option Explicit" as the first
line of your module and then declare all of your variables...

Dim RowIndex as Long
Dim shtCopy as Excel.Worksheet
'more of the same

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware