Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA Code Locked for Viewing

I have a spreadsheet that does not have a password for the file, but the code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed when
the file is closed? This will happen either when the user clicks the X or
when a button code runs to close the file and leave excel open or close excel
with application.quit. If the code leaves excel open, the password prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default VBA Code Locked for Viewing

the VBA has a separate password. Open the IDE (ALT+F11) then look under
Tools / VBA Project Properties
In the form, switch to the Protection tab - you'll see there that it may be
password protected



"AlForester" wrote in message
...
I have a spreadsheet that does not have a password for the file, but the
code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed
when
the file is closed? This will happen either when the user clicks the X or
when a button code runs to close the file and leave excel open or close
excel
with application.quit. If the code leaves excel open, the password prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA Code Locked for Viewing

Patrick,
I protected the code from prying eyes. My problem is when the user closes
the file, the password prompt is displayed. The user is not trying to access
the code, they are just closing the spreadsheet. Once the spreadsheet is
closed, the password prompt is displayed, the user does not know the password
and cannot dismiss the prompt. The user has to go to task manager and cancel
the process. In my code the user is never asked for a password or the
anything related to the password.
--
WEW


"Patrick Molloy" wrote:

the VBA has a separate password. Open the IDE (ALT+F11) then look under
Tools / VBA Project Properties
In the form, switch to the Protection tab - you'll see there that it may be
password protected



"AlForester" wrote in message
...
I have a spreadsheet that does not have a password for the file, but the
code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed
when
the file is closed? This will happen either when the user clicks the X or
when a button code runs to close the file and leave excel open or close
excel
with application.quit. If the code leaves excel open, the password prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default VBA Code Locked for Viewing

how strange. The VBA is protected separately so that the user can alter the
sheets and save changes. I've never heard of the password being asked for
like this. Does your code amend any code modules?


"AlForester" wrote in message
...
Patrick,
I protected the code from prying eyes. My problem is when the user closes
the file, the password prompt is displayed. The user is not trying to
access
the code, they are just closing the spreadsheet. Once the spreadsheet is
closed, the password prompt is displayed, the user does not know the
password
and cannot dismiss the prompt. The user has to go to task manager and
cancel
the process. In my code the user is never asked for a password or the
anything related to the password.
--
WEW


"Patrick Molloy" wrote:

the VBA has a separate password. Open the IDE (ALT+F11) then look under
Tools / VBA Project Properties
In the form, switch to the Protection tab - you'll see there that it may
be
password protected



"AlForester" wrote in message
...
I have a spreadsheet that does not have a password for the file, but
the
code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed
when
the file is closed? This will happen either when the user clicks the X
or
when a button code runs to close the file and leave excel open or close
excel
with application.quit. If the code leaves excel open, the password
prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default VBA Code Locked for Viewing

Hi

Just a guess.

Do you have a workbook_BeforeClose event in the workbook. If so there maybe
is an error in the code, which is stopping the code trying to show the code
module....

Hopes this helps.
....
Per

"AlForester" skrev i meddelelsen
...
Patrick,
I protected the code from prying eyes. My problem is when the user closes
the file, the password prompt is displayed. The user is not trying to
access
the code, they are just closing the spreadsheet. Once the spreadsheet is
closed, the password prompt is displayed, the user does not know the
password
and cannot dismiss the prompt. The user has to go to task manager and
cancel
the process. In my code the user is never asked for a password or the
anything related to the password.
--
WEW


"Patrick Molloy" wrote:

the VBA has a separate password. Open the IDE (ALT+F11) then look under
Tools / VBA Project Properties
In the form, switch to the Protection tab - you'll see there that it may
be
password protected



"AlForester" wrote in message
...
I have a spreadsheet that does not have a password for the file, but
the
code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed
when
the file is closed? This will happen either when the user clicks the X
or
when a button code runs to close the file and leave excel open or close
excel
with application.quit. If the code leaves excel open, the password
prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default VBA Code Locked for Viewing

Have a look at this article it may or may not be of some help to you.

Password prompt for VBA project appears after Excel quits
http://support.microsoft.com/kb/280454
--
jb


"AlForester" wrote:

I have a spreadsheet that does not have a password for the file, but the code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed when
the file is closed? This will happen either when the user clicks the X or
when a button code runs to close the file and leave excel open or close excel
with application.quit. If the code leaves excel open, the password prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA Code Locked for Viewing

Patrick,

The only code that I can think of or can find are a couple of calls and
changes to the sheets scrollarea property. They work as expected and
everything is fine. I tested this with a stripped down file and was not
asked for a password.

Per,

You suggested an error in BeforeClose event. I do have a BeforeClose event
with the following code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If (SaveWorkbook) Then

Call CleanupForClose
If (Not ThisWorkbook.Saved) Then ThisWorkbook.Save

End If

End Sub

Public Sub CleanupForClose()
Dim objWorksheet As Worksheet

For Each objWorksheet In Worksheets

objWorksheet.Activate
Call SplitScreen(objWorksheet)
Range("A1").Activate

Next objWorksheet
Sheet1.Activate
Application.Calculation = xlCalculationAutomatic

End Sub

Public Sub SplitScreen(objWorksheet As Worksheet, Optional lngRow As Long =
0, Optional lngCol As Long = 0)
On Error Resume Next

With objWorksheet

.Parent.Activate
.Activate
With ActiveWindow

.SplitColumn = lngCol
.SplitRow = lngRow

End With

End With

On Error GoTo 0

End Sub

This code compiles ok. SplitScreen is called from other code and works as
designed without errors.

When I did run across an error in the code, the dialog box would appear
indicating an error, but Debug code would be unavailable. The only option
was to end the code. The password prompt would not appear.

John,

I will dig into the parent child reference to see if this fits this situation.

Thanks all.
--
WEW


"Patrick Molloy" wrote:

how strange. The VBA is protected separately so that the user can alter the
sheets and save changes. I've never heard of the password being asked for
like this. Does your code amend any code modules?


"AlForester" wrote in message
...
Patrick,
I protected the code from prying eyes. My problem is when the user closes
the file, the password prompt is displayed. The user is not trying to
access
the code, they are just closing the spreadsheet. Once the spreadsheet is
closed, the password prompt is displayed, the user does not know the
password
and cannot dismiss the prompt. The user has to go to task manager and
cancel
the process. In my code the user is never asked for a password or the
anything related to the password.
--
WEW


"Patrick Molloy" wrote:

the VBA has a separate password. Open the IDE (ALT+F11) then look under
Tools / VBA Project Properties
In the form, switch to the Protection tab - you'll see there that it may
be
password protected



"AlForester" wrote in message
...
I have a spreadsheet that does not have a password for the file, but
the
code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed
when
the file is closed? This will happen either when the user clicks the X
or
when a button code runs to close the file and leave excel open or close
excel
with application.quit. If the code leaves excel open, the password
prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA Code Locked for Viewing

With excel 2003 and the following conditions:
(1) Create a UserForm
(2) Place a CommandButton on a sheet to open the form
(3) Create code to open the form
(4) Protect the VBA code from viewing with a password
(5) Close the spreadsheet and open it again so the code is locked

If you open the form and do not change anything on the spreadsheet, when the
spreadsheet is closed, there is not prompt for the password.

If you open the form and change a cell's value, either before or after the
form, when the spreadsheet is closed, there will be a prompt for the password.

--
WEW


"AlForester" wrote:

I have a spreadsheet that does not have a password for the file, but the code
is locked for viewing with a password.

Does anybody know what would cause the password prompt to be displayed when
the file is closed? This will happen either when the user clicks the X or
when a button code runs to close the file and leave excel open or close excel
with application.quit. If the code leaves excel open, the password prompt
appears when the user finally closes excel.

Any thoughts would be greatly appreciated.
--
WEW

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
Viewing of protected locked or unlocked cells jmisenar Excel Worksheet Functions 2 April 22nd 09 04:58 AM
Viewing Formulas in Locked Cells stacy05 Excel Discussion (Misc queries) 1 December 5th 07 04:10 PM
Is there any way of viewing the formula of a locked cell? td Excel Worksheet Functions 2 March 20th 07 08:13 PM
Viewing LOCKED cells AC_VID Excel Discussion (Misc queries) 1 April 9th 05 11:19 PM
Test for VBAProject Locked from Viewing DennisE Excel Programming 2 January 25th 04 09:02 PM


All times are GMT +1. The time now is 08:39 AM.

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

About Us

"It's about Microsoft Excel"