Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Trouble with copy of xlSheetVeryHidden

With CopySht
.Copy After:=Sheets(ThisWorkbook.Sheets.Count)
End With

forgot the "." before Copy

Tim

--
Tim Williams
Palo Alto, CA


"Casey" wrote in
message ...

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Trouble with copy of xlSheetVeryHidden


Tim,
Thanks for the reply. But I'm confused. My code shows a Period befor
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 mad
visable as a new worksheet.
The code works fine as long as the CopySht is only hidden, however whe
the CopySht's property is set to xlVeryHidden the code no longer work
and give the error message found in my original post.
Thanks again for your help

--
Case

-----------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...nfo&userid=454
View this thread: http://www.excelforum.com/showthread.php?threadid=39515

  #4   Report Post  
Posted to microsoft.public.excel.programming
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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Trouble with copy of xlSheetVeryHidden


Dave,
Thank you. The code worked great. I really like the Excel Forum,
however, the indents do seem to get lost. I really like building little
apps for the rest of the crew when I have time and want to learn the
best practices. Would it be better to post directly on the public
forums, rather than here? I just copy and paste my code out of the
editor into the thread dialog, do the public forums handle that better,
meaning keeping the formatting?
I'm a part-time programmer but a full time Construction estimator and
project manager, and as limited as my skills are, the resident geek at
work. I can't see an end to the possibilities for my industry.

Thanks again


--
Casey


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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Trouble with copy of xlSheetVeryHidden

Casey,

If you have either outllook express or outlook then you might be better off
connecting directly to microsoft.public.excel.programming than using one of
the web-based interfaces.
You'll find it a better experience.

Tim

--
Tim Williams
Palo Alto, CA


"Casey" wrote in
message ...

Dave,
Thank you. The code worked great. I really like the Excel Forum,
however, the indents do seem to get lost. I really like building little
apps for the rest of the crew when I have time and want to learn the
best practices. Would it be better to post directly on the public
forums, rather than here? I just copy and paste my code out of the
editor into the thread dialog, do the public forums handle that better,
meaning keeping the formatting?
I'm a part-time programmer but a full time Construction estimator and
project manager, and as limited as my skills are, the resident geek at
work. I can't see an end to the possibilities for my industry.

Thanks again


--
Casey


------------------------------------------------------------------------
Casey's Profile:

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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Trouble with copy of xlSheetVeryHidden

I agree with Tim. I don't like the web interface.

But do remember google for finding old posts (and answers to common questions).

Casey wrote:

Dave,
Thank you. The code worked great. I really like the Excel Forum,
however, the indents do seem to get lost. I really like building little
apps for the rest of the crew when I have time and want to learn the
best practices. Would it be better to post directly on the public
forums, rather than here? I just copy and paste my code out of the
editor into the thread dialog, do the public forums handle that better,
meaning keeping the formatting?
I'm a part-time programmer but a full time Construction estimator and
project manager, and as limited as my skills are, the resident geek at
work. I can't see an end to the possibilities for my industry.

Thanks again

--
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
my xlSheetVeryHidden is hidden and I can't unhide it - HELP! cristine Excel Discussion (Misc queries) 4 May 14th 23 11:46 AM
Can't get my xlSheetVeryHidden cristine Excel Worksheet Functions 2 June 26th 09 09:30 PM
Opeations on xlSheetVeryHidden worksheet Frederick Chow Excel Programming 4 March 10th 05 06:30 PM
xlSheetVeryhidden - still option to copy if you know the name of the sheet! cjorgensen[_4_] Excel Programming 2 January 16th 04 09:24 AM
xlSheetVeryHidden issue cjorgensen Excel Programming 2 January 12th 04 10:56 AM


All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"