-
notbrl
AskWoody LoungerJohn,
This Workbook
Private Sub Workbook_BeforeClose(Cancel As Boolean) TestShowSave End Sub
Private Sub Workbook_Open() TestHideSave End Sub
Module1
Sub TestHideSave() Dim FileMenu As CommandBarControl Set FileMenu = CommandBars(1).FindControl(ID:=30002) Application.OnKey "^{s}", "" FileMenu.Controls("&Save").Visible = False End Sub
Sub TestShowSave() Dim FileMenu As CommandBarControl Set FileMenu = CommandBars(1).FindControl(ID:=30002) Application.OnKey "^{s}" FileMenu.Controls("&Save").Visible = True End Sub
Brent
-
notbrl
AskWoody LoungerJohn,
Place these in the This Workbook module.
Private Sub Workbook_BeforeClose(Cancel As Boolean) TestShowSave End Sub
Private Sub Workbook_Open() TestHideSave End Sub
These would go in a module:
Sub TestHideSave() Dim FileMenu As CommandBarControl Set FileMenu = CommandBars(1).FindControl(ID:=30002) FileMenu.Controls("&Save").Visible = False End Sub
Sub TestShowSave() Dim FileMenu As CommandBarControl Set FileMenu = CommandBars(1).FindControl(ID:=30002) FileMenu.Controls("&Save").Visible = True End Sub
You still need to trap the Ctrl + S key combo.
This worked in a module but when I placed the code in the This Workbook mod it had a fit so I put the code back in a seperate mod and call them from the This Workbook. I have to go help someone move…I will check back tomorrow to see how it is going.
-
notbrl
AskWoody Loungeryou would write a macro disabling the desried command and place it in the workbook open event and then a macro to restore excel and place that one in the workbook close event.
both of these sites are full of excellent information on all things excel.
http://www.cpearson.com/excel.htm
http://www.j-walk.com/ss/excel/index.htmBrent
-
notbrl
AskWoody LoungerI would be inclined to think that it would be a matter of memory available as opposed to a limit on macros in a workbook or sheet.
-
notbrl
AskWoody LoungerI hang my head in shame…what a dufus.
Thank you for your response Legare.
-
notbrl
AskWoody Lounger…never mind. sheeezzzzz
With TextBox2 .SetFocus .SelStart = 0 .SelLength = Len(TextBox2.Text) End With
-
notbrl
AskWoody LoungerThis line was at the bottom of the Excel 2000 Help item on watermarks:
Background patterns do not print and are not retained in individual worksheets or items that you save as Web pages. However, if you publish an entire workbook as a Web page, the background is retained.
-
notbrl
AskWoody LoungerJanuary 9, 2002 at 11:29 pm in reply to: Allowing user interaction during macro execution (Word 2000) #562632this will open up the print preview window.
ActiveDocument.PrintPreview
I am not sure if this would help.
-
notbrl
AskWoody LoungerI don’t wish to pose any copywrite issues, so in the VBE – Help – Answer Wizard tab type in Ambiguous Name Detected and you will get a response of “Avoiding Naming Conflicts”
Hope this helps.
-
notbrl
AskWoody LoungerYEHAW!!!
Thanks to Wassim and Brook for your suggestions. I hacked and searched and hacked some more. Ripped hair out and searched and read and hacked till I was sure there was no way out. Then I tweaked a bunch of different examples that I found and came up with this:
Sub SampleADO() Dim cnConn As ADODB.Connection Dim rsRecd As ADODB.Recordset Dim rgTargetCell As Range Dim stConn As String Dim sADOCopyTest As String sADOCopyTest = "C:WINDOWSDesktopWorkADO test.xls" stConn = "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=" & sADOCopyTest Set cnConn = New ADODB.Connection cnConn.Open stConn Set rsRecd = cnConn.Execute("[TestRange]") Set rgTargetCell = ActiveCell rgTargetCell.CopyFromRecordset rsRecd rsRecd.Close cnConn.Close Set rsRecd = Nothing Set cnConn = Nothing End Sub
It may not be perdy but it WORKS!
-
notbrl
AskWoody LoungerI have tried at least 5 different routines that I found on the net and in books and I keep getting the same error.
I searched for and located the odbcjt.32.dll on my machine.
I have the driver and the file name / path was copied from the properties window.ayyeeeeeeeeeee I cant take it anymore…….
-
notbrl
AskWoody LoungerThanks for the response and the link. I don’t have 2.5 on my rig though. I have found some information on a couple of sites that I am going to review…
-
notbrl
AskWoody LoungerWassim,
I have been working on this in between meetings and have not made too much progress. This is the code I am running:
Sub TestADORetrieval() GetData "C:WINDOWSDesktopWorkADO test.xls", "Missed Sch Adj", & _ "AL4missADJ", Sheet1.Cells(1, 4), False End Sub
' reference set to Microsoft ActiveX Data Objects 2.1 Library Private Sub GetData(SrcFile$, SrcSheet$, SrcRange$, rTgt As Range, fHdr As Boolean) Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Dim a& Dim cnct$ ' Initialize a variable for the connection string cnct$ = "Driver={Microsoft Excel Driver(*.xls)};DBQ=" & SrcFile$ ' Initialize connection object Set cn = New ADODB.Connection With cn ' Open the database connection .Open cnct$
I am not too very familiar wtih ADO and am at a loss.
I have tried inserting “.Provider=MSDASQL;” in the connection string ahead of the driver arg, tried to create a DSN and have accomplished nothing. When the line in red runs I get this error message:
-
notbrl
AskWoody LoungerApplication.Dialogs(xlDialogPrint).Show
duhooohhh
-
notbrl
AskWoody LoungerFixed up the print code from work.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Blocking Search (on task bar) from going to web
by
HenryW
15 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
4 hours, 10 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
4 hours, 17 minutes ago -
regarding april update and may update
by
heybengbeng
5 hours, 46 minutes ago -
MS Passkey
by
pmruzicka
1 hour, 50 minutes ago -
Can’t make Opera my default browser
by
bmeacham
13 hours, 26 minutes ago -
*Some settings are managed by your organization
by
rlowe44
9 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
12 hours, 21 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
1 day, 8 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 17 hours ago -
AI slop
by
Susan Bradley
7 hours, 8 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 18 hours ago -
Two blank icons
by
CR2
6 hours, 3 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 days, 3 hours ago -
End of 10
by
Alex5723
2 days, 5 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 3 hours ago -
test post
by
gtd12345
2 days, 11 hours ago -
Privacy and the Real ID
by
Susan Bradley
2 days, 2 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
4 hours, 23 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 16 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 3 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
1 day, 7 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 days, 7 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 19 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
3 days, 9 hours ago -
Are manuals extinct?
by
Susan Bradley
10 hours, 15 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 19 hours ago -
Network Issue
by
Casey H
3 days, 6 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
4 days, 7 hours ago -
May 2025 Office non-Security updates
by
PKCano
4 days, 7 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.