View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Casey[_16_] Casey[_16_] is offline
external usenet poster
 
Posts: 1
Default Trouble with copy of xlSheetVeryHidden


Hi,
Below is code for copying a hidden worksheet into the same Workbook. It
works fine as long as the sheet is just hidden, however when I attempted
to change the sheets property to xlSheetVeryHidden, the code fails with
the following error message:

Run-time error '1004'
Method 'copy'of object'_worksheet_failed

Here is the code.

Sub Add_New_RFI()
Dim CopySht As Worksheet

Set CopySht = Worksheets("(0)")

Application.ScreenUpdating = False
With CopySht
..Copy After:=Sheets(ThisWorkbook.Sheets.Count)
End With
ActiveSheet.Visible = True
Application.ScreenUpdating = True
End Sub

Thanks in advance.


--
Casey


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