Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Trying Hard
 
Posts: n/a
Default Macro in "This Workbook"

Hello,

I actually have two questions.
I have, tried, to create a macro in "This Workbook", when I became
dissatisfied with it I simply deleted it. The problem is even though this
macro does not exist in "This Workbook" I still get a prompt (when opening)
that asks if I want to enable macro's.

Q1: How can I eliminate this?


The reason I tried to eliminate it is I recorded the macro that was supposed
to, unprotect the workbook / unhide a page, the macro is erroneous though; it
looks like this:

' Keyboard Shortcut: Ctrl+Shift+U
'
ActiveWorkbook.Unprotect
Sheets("2005 Summary, Exhaustive").Visible = True
End Sub

The macro would work perfectly if when I hit the shortcut key's it would:
unprotect the workbook / unhide a sheet named "2005 Summary, Exhaustive" /
and automatically return the protection settings back when the user closes
the file.

Q2: Can this be done, if so how?


Thanks for any help!

--
Thank you,

Trying Hard
  #2   Report Post  
Posted to microsoft.public.excel.misc
Anne Troy
 
Posts: n/a
Default Macro in "This Workbook"

Q1: See:
http://www.officearticles.com/excel/...ft_excel .htm
Q2: Sure. You'll need to create a macro that protects the workbook. Record
that. Then hit Alt+F11 and get the "guts" (delete the sub/end sub line) of
that code, and double-click the ThisWorkbook module. From the drop-downs at
top-right, choose Workbook, and Before Close, paste the guts between the sub
and end sub lines that are created.
Hit the save diskette! Also realize that your password will be stored in the
VBA code, so anyone who knows how to read it, can see it....
************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Trying Hard" wrote in message
...
Hello,

I actually have two questions.
I have, tried, to create a macro in "This Workbook", when I became
dissatisfied with it I simply deleted it. The problem is even though this
macro does not exist in "This Workbook" I still get a prompt (when
opening)
that asks if I want to enable macro's.

Q1: How can I eliminate this?


The reason I tried to eliminate it is I recorded the macro that was
supposed
to, unprotect the workbook / unhide a page, the macro is erroneous though;
it
looks like this:

' Keyboard Shortcut: Ctrl+Shift+U
'
ActiveWorkbook.Unprotect
Sheets("2005 Summary, Exhaustive").Visible = True
End Sub

The macro would work perfectly if when I hit the shortcut key's it would:
unprotect the workbook / unhide a sheet named "2005 Summary, Exhaustive"
/
and automatically return the protection settings back when the user closes
the file.

Q2: Can this be done, if so how?


Thanks for any help!

--
Thank you,

Trying Hard



  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Macro in "This Workbook"

Debra Dalgleish shows how to clean up all the remnants of macros:
http://www.contextures.com/xlfaqMac.html#NoMacros

And I think I would have a macro named auto_open that would unprotect the
workbook, hide whatever sheets you want hidden and then reprotect the workbook.

Trying Hard wrote:

Hello,

I actually have two questions.
I have, tried, to create a macro in "This Workbook", when I became
dissatisfied with it I simply deleted it. The problem is even though this
macro does not exist in "This Workbook" I still get a prompt (when opening)
that asks if I want to enable macro's.

Q1: How can I eliminate this?


The reason I tried to eliminate it is I recorded the macro that was supposed
to, unprotect the workbook / unhide a page, the macro is erroneous though; it
looks like this:

' Keyboard Shortcut: Ctrl+Shift+U
'
ActiveWorkbook.Unprotect
Sheets("2005 Summary, Exhaustive").Visible = True
End Sub

The macro would work perfectly if when I hit the shortcut key's it would:
unprotect the workbook / unhide a sheet named "2005 Summary, Exhaustive" /
and automatically return the protection settings back when the user closes
the file.

Q2: Can this be done, if so how?


Thanks for any help!

--
Thank you,

Trying Hard


--

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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Can T Get Macro To Run! Nipper New Users to Excel 2 November 4th 05 04:48 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 07:26 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"