password protection paramenters

Hello, I want to be able to unprotect my sheet, add a wordart graphi
and reprotect my sheet. The problem I am having is when I do this wit
code the file is protected with the default parameters selected. I wan
to be able to enable wordart so I can insert a wordart object and the
protect the sheet again. 
I want to get around the user being able to just delect the added wor
art.
When protected I would like the following parameters to be set:

Allow users to

select locked cells
select Unlocked cells
format cells
format rows

Its the "edit objects" parameter that needs to be enabled for me to ad
a wordart object.


This is what I have so far.

Private Sub CommandButton3_Click()
response = MsgBox("This document will be stamped COPY. ", _
vbYesNo)

If response = vbYes Then


Set myDocument = ActiveSheet
Set myWatermark = myDocument.Shapes.AddTextEffect( _
PresetTextEffect:=msoTextEffect1, _
text:="Draft", _
FontName:="Arial Black", _
FontSize:=100, _
FontBold:=False, _
FontItalic:=False, _
Left:=218.75, _
Top:=159.75)
With myWatermark
.IncrementRotation -43.46
.Fill.Visible = msoFalse
.Fill.Transparency = 0.5
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 55
.Line.BackColor.RGB = RGB(255, 255, 255)
.ZOrder msoBringToFront

End With
Dim strClient As String
'Dim csPATH As String

strClient = Application.InputBox("Enter your file name")

Const csPATH As String = "c:\"
ActiveWorkbook.SaveCopyAs csPATH & Trim(strClient) & " PO For
Copy.xls"
MsgBox strClient & " PO Form Copy.xls has been saved to C:\"

ElseIf vbNo Then
Exit Sub
End If


Also, is there a way to have it prompt the user for a path? Like 
browse button so they can save it where they would like?
Thanks for ANY help

--
Message posted from http://www.ExcelForum.com

0
2/27/2004 10:51:39 PM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
425 Views

Similar Articles

[PageSpeed] 38

I'm assuming you have Excel 2002 or 2003.

Here's code that will unprotect the sheet (assuming a password of "xxx"),
then a placeholder for your add WordArt object code, then reprotect with a
password and the parameters you suggested:

    ActiveSheet.Unprotect Password:="xxx"
    'Add the WordArt graphic here
    ActiveSheet.Protect Password:="xxx", DrawingObjects:=True,
Contents:=True, Scenarios:=True _
        , AllowFormattingCells:=True, AllowFormattingRows:=True

DrawingObjects:=True will prevent users from deleting any graphic.

Below is a routine that prompts the user for a filename, then save a copy
using the name (and location) along with your PO Form text as part of the
name:

Sub SaveCopyExample()

    Const szFILE_NAME_END As String = " PO Form Copy"

    Dim szFileName As String

    szFileName = Application.GetSaveAsFilename(, "Excel Files
(*.xls),*.xls", , "Save PO Form")

    If szFileName <> "False" Then
        'Pull out the ".xls" and add "PO Form Copy" to the end and then
re-add the xls extension
        szFileName = Left$(szFileName, Len(szFileName) - 4) &
szFILE_NAME_END & ".xls"

        'Save the filename
        ActiveWorkbook.SaveCopyAs szFileName
    End If

End Sub


--
__________________
Robert Rosenberg
R-COR Consulting Services
Microsoft MVP - Excel


"clayton >" <<clayton.12b4k1@excelforum-nospam.com> wrote in message
news:clayton.12b4k1@excelforum-nospam.com...
> Hello, I want to be able to unprotect my sheet, add a wordart graphic
> and reprotect my sheet. The problem I am having is when I do this with
> code the file is protected with the default parameters selected. I want
> to be able to enable wordart so I can insert a wordart object and then
> protect the sheet again.
> I want to get around the user being able to just delect the added word
> art.
> When protected I would like the following parameters to be set:
>
> Allow users to
>
> select locked cells
> select Unlocked cells
> format cells
> format rows
>
> Its the "edit objects" parameter that needs to be enabled for me to add
> a wordart object.
>
>
> This is what I have so far.
>
> Private Sub CommandButton3_Click()
> response = MsgBox("This document will be stamped COPY. ", _
> vbYesNo)
>
> If response = vbYes Then
>
>
> Set myDocument = ActiveSheet
> Set myWatermark = myDocument.Shapes.AddTextEffect( _
> PresetTextEffect:=msoTextEffect1, _
> text:="Draft", _
> FontName:="Arial Black", _
> FontSize:=100, _
> FontBold:=False, _
> FontItalic:=False, _
> Left:=218.75, _
> Top:=159.75)
> With myWatermark
> IncrementRotation -43.46
> Fill.Visible = msoFalse
> Fill.Transparency = 0.5
> Line.Weight = 0.75
> Line.DashStyle = msoLineSolid
> Line.Style = msoLineSingle
> Line.Transparency = 0#
> Line.Visible = msoTrue
> Line.ForeColor.SchemeColor = 55
> Line.BackColor.RGB = RGB(255, 255, 255)
> ZOrder msoBringToFront
>
> End With
> Dim strClient As String
> 'Dim csPATH As String
>
> strClient = Application.InputBox("Enter your file name")
>
> Const csPATH As String = "c:\"
> ActiveWorkbook.SaveCopyAs csPATH & Trim(strClient) & " PO Form
> Copy.xls"
> MsgBox strClient & " PO Form Copy.xls has been saved to C:\"
>
> ElseIf vbNo Then
> Exit Sub
> End If
>
>
> Also, is there a way to have it prompt the user for a path? Like a
> browse button so they can save it where they would like?
> Thanks for ANY help!
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
bladex (6)
2/28/2004 12:46:04 AM
THANKS!
THis works well with only a couple of exceptions...
Normally when you do a Save as you will close the original and leav
you in the saved as file. Your script is working perfectly but I woul
like for them to actually be IN the saved file after they do the Sav
As. 
As it is now it is leaving the graphic on the master sheet after you d
a save as. I know its probably something very simple but I am very ne
to all of this and you guys are SO GOOD!
Thanks for your help

--
Message posted from http://www.ExcelForum.com

0
3/1/2004 4:32:21 PM
Well, I have most of what I need sorted out. Since doing a SaveAs in VB
does not leave  you in the saved file I am in need of a way to reopen
the file that was just saved. I can close the existing file but how can
i open the last saved file at the same time?

If the SaveAs function would work the save as going to the file menu
and choosing File, SaveAs then all would be fine...


---
Message posted from http://www.ExcelForum.com/

0
3/2/2004 4:01:24 AM
Take a look at Robert's code once more.  He didn't actually use .SaveAs.  He
used .savecopyas:

ActiveWorkbook.SaveCopyAs szFileName

If you used that code, try changing it to .saveas and see what happens.

"clayton <" wrote:
> 
> Well, I have most of what I need sorted out. Since doing a SaveAs in VB
> does not leave  you in the saved file I am in need of a way to reopen
> the file that was just saved. I can close the existing file but how can
> i open the last saved file at the same time?
> 
> If the SaveAs function would work the save as going to the file menu
> and choosing File, SaveAs then all would be fine...
> 
> ---
> Message posted from http://www.ExcelForum.com/

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
3/2/2004 11:56:00 PM
Reply:

Similar Artilces:

Password Protect When Saved
Is there a way of setting up a password, so if the save button is pressed a password is needed before the program can be saved. Also people. I am trying to write some code so when a button in my program is pressed it exits without saving. I have - ActiveWorksheet.Close I can not figure out what to put next, nothing I seem to wite is working "Nick" wrote: > Is there a way of setting up a password, so if the save button is pressed a > password is needed before the program can be saved. The easy question. You could have a button (from the Forms toolbar) that looks like ...

Search for Password Protected Files
I have a CD with a bunch of Excel files on it. I need to find the ones that are password protected, is there by any chance a way to find such files?? Please say yes!! Thank you! Doreen Password protected--To Open or to modify???? If to Open, then this seemed to work ok: Option Explicit Sub testme01() Application.ScreenUpdating = False Dim myFiles() As String Dim fCtr As Long Dim myFile As String Dim myPath As String Dim testWkbk As Workbook Dim logWks As Worksheet Dim oRow As Long Set logWks = Workbooks.Add(1).Worksheets(1) logWks...

How to get rid of password?
My wife is being driven mad by the request to change her password on her Vista laptop about every two weeks. I don't know all that much about Vista, being a XP man, but I have followed the instructions to remove password but it always seems to come back. All she wants is to be able to turn on her laptop in the morning and never be asked for a password again. Quite simple really - so how can I persuade Vista to do this please? Try this:http://www.vistax64.com/tutorials/66966-logon-automatically.html -- brummyfan On 30 Mar, 09:40, brummyfan <gu...@unknown-email.c...

2003 OWA
We are having problems when end users hit the cancel button on the Exchange 2003 OWA password change screen, it actually gives an ASP error when hitting the cancel button on this particular screen. Does anyone have an TechNet Articles on why this doesn't work? Dear Sabo, Thanks for posting here. In order to narrow down the problem, please provide me with the detailed message of the ASP error. You may capture a screen shoot and attach the picture when you post back. Also, I would like to give you the detailed steps for enable change password in Exchange 2003 OWA: You must firs...

Passwords work only when issued from the GP instance they're set f
Database is: "Microsoft SQL Server 2005 - 9.00.4035.00 (X64) on Windows 2008 Build 6002: Service Pack 2 64-bit. Dynamics is deployed via Terminal Services on a Windows 2003 SP2 32-bit server. Dynamics was installed on both servers using the base v10 CDs and then upgraded to the lates pre SP4 hotfix 10.00.1328 (KB971014) on both servers. Now the weird part. I can log in as 'sa' on both servers no problem. However, if I login to Dynamics on the TS as 'sa' and reset my password, I can log into the TS with my username & password but can't login from GP on the...

Crystal Reports XI password storage
In earlier versions of Crystal Reports, the user id and password to access the GP tables were able to be stored in the connection properties so that they did not have to be entered when refreshing a report. I can store the used id, but I have not been able to find a way to store the password in Crystal Reports XI. Does anyone know if this is still possible and how it can be done? Thanks. How Early? I have been using Crystal since V4 and don't remember that. However, You can set up a trusted group and use that trusted relationship when creating your reports. In this manner, y...

Outlook Express prompting for domain/username/password
I'm not sure if this is the right NG for OE questions but I didn't find one just for OE. My Exchange server has SMTP Authentication enabled so users can send e-mail through it even if they're on the road with their laptops. The problem is that OE asks for the username, password and the NT Domain every time a user tries to send a message. The username and password are saved in the account settings (for both POP3 and SMTP). Is there a way to get rid of the username/password/domain dialog box? TIA :) Fritz <fritz@dontbite.com> wrote: > I'm not sure if this...

OWA Users/Expired passwords
I have several users who will only be logging in to Outlook Web Access (Exchange 2003), and once they're logged in to OWA they can change their passwords, but if they for some reason let their passwords expire, OWA doesn't allow them the opportunity to change their passwords; this is the case whether we use a dialog login box or forms-based authentication. Is there any way we can set OWA so that it automatically takes a user to the IIS password change screen if someone tries to log in with an expired password? this should solve your problem http://www.petri.co.il/enable_pass...

Moving Money 2000 to new computer needs password
Hi - I received a new computer and I am moving all of me software from the old one before I get rid of it. I installed the copy of Money 2000 that I had on the old computer. When I copy my msmoney.mny file to the new computer and attemt to open it, it says I need to enter the password for the file. Problem is, I never created a password for it, so I can open the file. Any suggestions? In microsoft.public.money, Wes wrote: >Hi - > > I received a new computer and I am moving all of me software from the old >one before I get rid of it. I installed the copy of Money ...

Tab down instead of right in protected cells
Is there a way to decide the tab order in a worksheet when certain cells has been locked and protected? I know it is possible in Access, what about Excel 2003? >> what about Excel 2003? No. Right and then Down 24/7. -- Jim "Ingibjorg Hinriksdottir" <IngibjorgHinriksdottir@discussions.microsoft.com> wrote in message news:5BAB0831-F2B8-4899-A57D-13E1283865D5@microsoft.com... | Is there a way to decide the tab order in a worksheet when certain cells has | been locked and protected? I know it is possible in Access, what about Excel | 2003? a stretch, but here'...

Password Protect Project Files
Is it possible to password protect local .mpp files in Project '07? I know this functionality is possible in other MS Office applications, but I cannot find that option in Project Pro '07. Does anyone know if it is included in Project 2010? Check File > Save As > Tools > General Options This won't work if you save to the server, but only for local .mpp files. I presume it's the same in 2010. - Andrew Lavinsky Blog: http://blogs.catapultsystems.com/epm > Is it possible to password protect local .mpp files in Project '07? I > know this ...

Protect worsheet, but allow user to hide rows
How do I protect a worksheet with some cells locked, but then still allow a user to hide and uhide rows? Maybe provide a macro that would unprotect the worksheet, hide the selected rows, and then reprotect the worksheet???? SeattleSus wrote: > > How do I protect a worksheet with some cells locked, but then still allow a > user to hide and uhide rows? -- Dave Peterson ...

"Remember password" not available
Hello ! I am running XP pro SP3, OE 6, IE 7; my system language is Italian, but I hope that the problem will be understood anyway. I use OE 6 for my email, I have 3 accounts and all do the same. When I click Send/Receive I have a window asking for the password of the account, but I cannot flag "Remember password". In Account manager, the "Remeber password" has the same behaviour, it is not flaggable. Apart this, OE 6 is working OK. Any help ? Thanks in advance, Enrico (Chicchio) Pick whatever applies. For the OE logon password: Your ISP may be able to te...

Outlook 2003 won't save password in pop3 account settings
I am trying to set my email account settings to remember my password and it still prompts me everytime I send or receive email for the password. If I type it in, I have no trouble connecting and getting mail though. I am working through a citrix terminal to connect to outlook 2003 running on our company server. Is this a known bug? Is there a patch? Help! Sean Cartwright ...

Outlook Prompts for E-mail Account and Password Even Though "Save Password" Has Been Checked (XP)
The OS is XP Pro. One user, Adminstrator, password login. I can't recall if it's Outlook 2000 or 2003. Multiple e-mail accounts. Every time he gets his e-mail, Outlook prompts for the account logins and passwords. He checks the "save password" box and it gets the mail. But the next time he gets his e-mail, Outlook prompts for the accountnames and passwords again. Any idea why? Peter, I have had the same problem ever since I upgraded to Outlook 2002. Hope someone has the answer. This also happens on several of my web based email sites. I check the Remember my login and p...

Newbee: Compiler says to me that public function pointer is protected
I'm studying how to create simple dlls. Following the sample I created one simple dl (code below): ..h file: #ifdef DLLFUNC_EXPORTS #define DLLFUNC_API __declspec(dllexport) #else #define DLLFUNC_API __declspec(dllimport) #endif DLLFUNC_API double Fatorial(double nNumber); the .def file: LIBRARY DLLFunc EXPORTS Fatorial @ 1 the .cpp file: DLLFUNC_API double Fatorial(double nNumber) { double Result = 1; for(; nNumero > 1; nNumber--) { Result *= nNumber; } return Result; } Following I've created a simple MFC dialog app to test the dll. In the testDLLFuncApp::InitIn...

how to retrieve data from password protected web pages?
how can I retrieve data from password protected web pages in excel? ...

how do I set up outlook with my Comcast user name and password
How do I configure Outlook to my Comcast e-mail? emi wrote: > How do I configure Outlook to my Comcast e-mail? Configure all the settings in Outlook according to the information Comcast gives you. This is for Outlook 2002 (but you can find how to do for other versions here, too): http://www.comcast.com/Support/Corp1/FAQ/FaqDetail_2287.html "emi" <emi@discussions.microsoft.com> wrote in message news:393A5521-6E8E-4459-B5B5-69BCDF04F087@microsoft.com... > How do I configure Outlook to my Comcast e-mail? ...

"Enter Network Password" Keeps Popping Up
Have WinXP Home and recently I've been getting the "Enter Network Password" dialogue box popping up at inopportune times. How do I get rid of this? Thanks. May be, ticking the save password box would help. >-----Original Message----- >Have WinXP Home and recently I've been getting the "Enter Network Password" >dialogue box popping up at inopportune times. How do I get rid of this? > >Thanks. > > >. > ...

enforce user change their password every 30 days
Hi we are using GP9 and sql2005. How do I set up user password change every 30 days? Thanks Set this in the user setup window against the advanced sql server options. You need to have a Windows Server 2003 domain for this to work - if you don't have this, then the option will be grayed out. I believe SQL Server just enforces the Windows domain password policy, so I think you would need to set that to password change every 30 days. "mecn" wrote: > Hi > > we are using GP9 and sql2005. How do I set up user password change every 30 > days? > > Than...

Can you supply ACCDB's password in OpenDatabase method?
Can you supply the password in Visual Basic code for an ACCDB file that you wish to open using the OpenDatabase method? The following is pulled from the Access help file Syntax Set database = workspace.OpenDatabase (dbname, options, read-only, connect) .... The connect argument is expressed in two parts: the database type, followed by a semicolon (;) and the optional arguments. You must first provide the database type, such as "ODBC;" or "FoxPro 2.5;". The optional arguments follow in no particular order, separated by semicolons. One of the parameter...

protect a single cell
I would like to know how to protect a single cell, but the user can still add another row or column without unprotecting the sheet. Hi Mahesh! You can only allow insertion of rows and columns in Excel 2002 and 2003. The approach is to change the defaults in the Tools > Protection > Protect Sheet dialog. Place checks against "Insert Columns" and "Insert Rows" To protect a single cell: Select all cells on the sheet by clicking the button at the intersection of Row numbers and Column letters Format > Cells > Protection Tab Remove check from "Locked" ...

New Password
My financial instituion made me change my login ID to access my accounts online. I need to change that information in Money, but I'm not sure how. Anyone? ...

Password Protection
How do I prevent a workbook from being opened until a password is entered. I have tried the Tools>Protection>Protect Sheet>Protect Workbook and Protect and Share Workbook. But each time I save and close the workbook, I can open it without entering a password. TIA! Hi File > Save as , in the 'Save as' dialogue box, click on 'Tools' Click on 'General Options', and enter a password. Hope this is what you are looking for. George Gee *Floridagal* has posted this message: > How do I prevent a workbook from being opened until a password is > ente...

Read-only files
I want to email an MS Publisher 03 file. It is read-only protected, but it can still be accessed and changes made, although it has to be saved with another file name. Is it possible to make it unaccessible - so that no changes can be made at all? no. and it doesn't even have to be saved with a different name, all you have to do is change the file attributes. "secretariat" <secretariat@discussions.microsoft.com> wrote in message news:0CFB98E4-29E7-4AC6-BBB4-177EE7F5C982@microsoft.com... |I want to email an MS Publisher 03 file. It is read-only protected, but it |...