View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Trouble with copy of xlSheetVeryHidden

I think that when you post through excelforum, that those leading dots can get
eaten up (and your indentation looks pretty funny, too--but I'm not sure if
that's your code or excelforum).

Anyway, this worked ok for me:


Option Explicit
Sub Add_New_RFI2()
Dim CopySht As Worksheet
Dim myVis As Long

Set CopySht = Worksheets("(0)")

Application.ScreenUpdating = False
With CopySht
myVis = .Visible
.Visible = xlSheetVisible
.Copy After:=Sheets(ThisWorkbook.Sheets.Count)
.Visible = myVis
End With

Application.ScreenUpdating = True
End Sub


Casey wrote:

Tim,
Thanks for the reply. But I'm confused. My code shows a Period before
Copy. Did I misunderstand your post?
Maybe I was too cryptic in my first explaination.
I'm using a hidden sheet as a "template" that is copied and made
visable as a new worksheet.
The code works fine as long as the CopySht is only hidden, however when
the CopySht's property is set to xlVeryHidden the code no longer works
and give the error message found in my original post.
Thanks again for your help.

--
Casey

------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=395158


--

Dave Peterson