Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default possible to record vba editing as a macro

Excel2003 and 2007

I have an application that has worksheet and workbook unprotection and
protection at the begining and end of every procedure. When I have to do any
debugging, everytime i change a view or click on a button my workbook and
sheets are reprotected.

Is there a way (Easy) to comment out all the protection while i'm debugging
and then un-comment it after i'm done?

I was thinking maybe a sub routine i can assign to a button.

Is it possible to use macro recorder inside the VBE?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default possible to record vba editing as a macro

Try disabling events while debugging.

Sub disable_events()
Application.EnableEvents = False
End Sub

Sub enable_events()
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Sep 2008 11:44:16 -0700, Gizmo
wrote:

Excel2003 and 2007

I have an application that has worksheet and workbook unprotection and
protection at the begining and end of every procedure. When I have to do any
debugging, everytime i change a view or click on a button my workbook and
sheets are reprotected.

Is there a way (Easy) to comment out all the protection while i'm debugging
and then un-comment it after i'm done?

I was thinking maybe a sub routine i can assign to a button.

Is it possible to use macro recorder inside the VBE?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default possible to record vba editing as a macro

Hi Gord,

I still want to be able to run the prucedures to make sure my "fixes" work.
I just don't want to have to unprotect after every button click.
"Gord Dibben" wrote:

Try disabling events while debugging.

Sub disable_events()
Application.EnableEvents = False
End Sub

Sub enable_events()
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Sep 2008 11:44:16 -0700, Gizmo
wrote:

Excel2003 and 2007

I have an application that has worksheet and workbook unprotection and
protection at the begining and end of every procedure. When I have to do any
debugging, everytime i change a view or click on a button my workbook and
sheets are reprotected.

Is there a way (Easy) to comment out all the protection while i'm debugging
and then un-comment it after i'm done?

I was thinking maybe a sub routine i can assign to a button.

Is it possible to use macro recorder inside the VBE?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default possible to record vba editing as a macro

Run Gord's disable_events procedure before you start your development work.

Do all your changes.

Run the enable_events when you're done making changes and ready to test.

Gizmo wrote:

Hi Gord,

I still want to be able to run the prucedures to make sure my "fixes" work.
I just don't want to have to unprotect after every button click.
"Gord Dibben" wrote:

Try disabling events while debugging.

Sub disable_events()
Application.EnableEvents = False
End Sub

Sub enable_events()
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Sep 2008 11:44:16 -0700, Gizmo
wrote:

Excel2003 and 2007

I have an application that has worksheet and workbook unprotection and
protection at the begining and end of every procedure. When I have to do any
debugging, everytime i change a view or click on a button my workbook and
sheets are reprotected.

Is there a way (Easy) to comment out all the protection while i'm debugging
and then un-comment it after i'm done?

I was thinking maybe a sub routine i can assign to a button.

Is it possible to use macro recorder inside the VBE?




--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default possible to record vba editing as a macro

Yea, I got that.

I was hopin to comment out the protection only and still be able to run
everything else.

Thank You

"Dave Peterson" wrote:

Run Gord's disable_events procedure before you start your development work.

Do all your changes.

Run the enable_events when you're done making changes and ready to test.

Gizmo wrote:

Hi Gord,

I still want to be able to run the prucedures to make sure my "fixes" work.
I just don't want to have to unprotect after every button click.
"Gord Dibben" wrote:

Try disabling events while debugging.

Sub disable_events()
Application.EnableEvents = False
End Sub

Sub enable_events()
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Sep 2008 11:44:16 -0700, Gizmo
wrote:

Excel2003 and 2007

I have an application that has worksheet and workbook unprotection and
protection at the begining and end of every procedure. When I have to do any
debugging, everytime i change a view or click on a button my workbook and
sheets are reprotected.

Is there a way (Easy) to comment out all the protection while i'm debugging
and then un-comment it after i'm done?

I was thinking maybe a sub routine i can assign to a button.

Is it possible to use macro recorder inside the VBE?



--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default possible to record vba editing as a macro

Don't know what your code is doing and how many sheets are affected.

Sounds like some of the code involves events if changing a view triggers
code.

You could run this macro when necessary.

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme" 'adjust to suit
'Sheet(N).UnProtect 'if no password
Next N
Application.ScreenUpdating = True
End Sub

Short of that I can't think of a way to achieve your "comment out" the
protection lines in all subs and modules.


Gord

On Thu, 11 Sep 2008 13:21:02 -0700, Gizmo
wrote:

Yea, I got that.

I was hopin to comment out the protection only and still be able to run
everything else.

Thank You

"Dave Peterson" wrote:

Run Gord's disable_events procedure before you start your development work.

Do all your changes.

Run the enable_events when you're done making changes and ready to test.

Gizmo wrote:

Hi Gord,

I still want to be able to run the prucedures to make sure my "fixes" work.
I just don't want to have to unprotect after every button click.
"Gord Dibben" wrote:

Try disabling events while debugging.

Sub disable_events()
Application.EnableEvents = False
End Sub

Sub enable_events()
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Sep 2008 11:44:16 -0700, Gizmo
wrote:

Excel2003 and 2007

I have an application that has worksheet and workbook unprotection and
protection at the begining and end of every procedure. When I have to do any
debugging, everytime i change a view or click on a button my workbook and
sheets are reprotected.

Is there a way (Easy) to comment out all the protection while i'm debugging
and then un-comment it after i'm done?

I was thinking maybe a sub routine i can assign to a button.

Is it possible to use macro recorder inside the VBE?



--

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
What does it mean to record the macro Liz Excel Discussion (Misc queries) 6 March 15th 07 07:35 PM
Record New Macro ju1eshart Setting up and Configuration of Excel 3 August 25th 06 04:21 PM
how do i record total editing time? Jane Excel Discussion (Misc queries) 1 July 15th 05 11:13 AM
Unable to record macro Pat Excel Discussion (Misc queries) 4 May 20th 05 01:43 AM
Record new macro ghosted Pat Excel Discussion (Misc queries) 1 January 7th 05 04:26 PM


All times are GMT +1. The time now is 04:24 PM.

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"