xlSheetVeryHidden issue

  • Thread starter Thread starter cjorgensen
  • Start date Start date
C

cjorgensen

Hello,
I am currently creating an application where I have the following
issue:

My file includes several sheets that should not be accessible for the
user. Some of the sheets though contains data that my code needs to
access - and since it is not possible to copy a range (or is there a
way??) without unhiding the sheet temporarily, the program will be
vournable if the users breaks the processing of the code (by
Ctrl+Break).

Is there
a) some way to access data from the sheets (we are talking thousands of
rows) without using copy function?
b) Is there some way to prevent the user from breaking excecution using
Ctrl+Break?

Hope someone can help me out there!!

Greetings from Norway,
Christian
 
The sub below works, also copy & paste "Application.EnableCancelKey" into a
module then select it and press F1 to read the help file.
Be careful with Application.EnableCancelKey = xlDisabled, if you have code
that gets in an infinite loop there will be no way to stop it, except by
using task manager! Be sure to enable it again at the end of the sub.

Sub Test()
Sheet1.Visible = xlSheetVeryHidden
Sheet2.Range("A1:A4").Value = Sheet1.Range("A1:A4").Value
End Sub
 
cjorgensen > said:
My file includes several sheets that should not be accessible for the
user. Some of the sheets though contains data that my code needs to
access - and since it is not possible to copy a range (or is there a
way??) without unhiding the sheet temporarily, the program will be
vournable if the users breaks the processing of the code (by
Ctrl+Break).

As long as you do not select the hidden sheet, it is simple to copy from it.
This code shows the principle

Worksheets(1).Range("A1:A3").Copy Destination:=Worksheets(2).Range("A1")

Is there
a) some way to access data from the sheets (we are talking thousands of
rows) without using copy function?
b) Is there some way to prevent the user from breaking excecution using
Ctrl+Break?

Similarly, access the data through the worksheet

Worksheets(1).Range("A1:A3")


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top