Disable scrolling when macros disabled

A

anon

Hi,

When my wb is opened with macros disabled only one sheet is visible. I
want to prevent the user from scrolling on this sheet, which i can do
when macros are enabled but not when discabled. Is there a way to do
this? (I tried setting the scroll area but this doesn't seem to take
effect when macros are disabled).
 
P

pswanie

not clear what exactly you need.... but would zoom page to about 70% then
freeze panes in the very bottom right hand conner. then zoom back to 100%?
 
P

pswanie

copy and paste the following in youre this workbook code

it will when u close it freeze panes and if u open with out macro's enable
keep it freeze(unable to scroll) if macro's enabled it will be able to scroll


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Range("v60").Select
ActiveWindow.FreezePanes = True
End Sub

Private Sub Workbook_Open()
ActiveWindow.FreezePanes = False
End Sub
 
G

Gord Dibben

Render the workbook useless if users disable macros.

In a beforeclose event, hide all sheets but a dummy sheet with the message "By
disabling macros you have made this workbook useless. Close and enable macros
to continue."

When users enable macros have workbook_open code that hides dummy sheet and
makes your working sheet visible with the scrollarea set as you wish.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top