Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 11-27-2013, 10:29 AM
BobBridges's Avatar
BobBridges BobBridges is offline Removing a password from a worksheet Windows 7 64bit Removing a password from a worksheet Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Aha! Good call, macropod. Funky, this is why I've gotten into the habit of qualifying almost everything in VBA; there are just too many ways to lose track of what the default may be. Besides, a lot of programs I write work with multiple worksheets, workbooks etc. So I find it a useful habit to just define a variable for each object I'll be working with, something like this:
Code:
Set woIp = ThisWorkbook
Const wnOp = "TLXI.xlsx"
If Not Exists(Workbooks,wnOp) Then Abend "Can't find workbook " & wnOp
Set woOp = Workbooks(wnop)
Set soIp = woIp.Worksheets("Misc")
woOp.Worksheets.Add
set soOp = ActiveWorksheet
soOp.Name = "New"
Once I have all the objects defined, then for the rest of the program I can refer to soIp.Cells, woOp.SaveAs and so on without worrying that my program will do something unexpected. That is, programs almost always do something unexpected, but this cuts down on the puzzlement.
Reply With Quote
 

Tags
password, remove password



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protected file no longer offers password dialog on Open htaylor Word 0 10-15-2013 12:35 PM
Removing a password from a worksheet How to summarise different worksheet to a summary worksheet samkiewhock Excel 1 09-06-2012 03:34 AM
Removing a password from a worksheet Outlook requests password afeter changing windows password pask Outlook 5 03-16-2012 08:43 AM
Removing a password from a worksheet Removing password protection HantsDave Word VBA 9 03-08-2012 11:57 AM
Removing a password from a worksheet Trouble Removing Password cure4glass Word 1 02-17-2012 07:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft