How could i enable insert picture from VBA?

J

jose luis

Hello Friends,

I´m trying to insert a logo to a Excel file from VBA in a protecte
worksheet. Could you give a hand to allow the user change the logo i
he needs it?

Thanks in advance,

Jose Lui
 
T

Tom Ogilvy

Sub InsertPicture()

Activesheet.UnProtect Password:="ABCD"
' code to insert picture and position it
Activesheet.Protect Password:="ABCD"

End Sub
 
J

jose luis

Thank you Tom for your prompt response (as always!!).

Let explain my problem in a better way. I have a sheet that i
protected, has some stuff that needs to be untouchable by the user, bu
i would like to allow her/him to be able to change some text and a Logo
The solution already given (thanks again) unprotects the entire sheet
Is there a instruction that let me just give her/him the opportunity t
enable the Insert/Picture/from file command, without giving her/him th
chance to play around?

Best Regards

Jose Lui
 
T

Tom Ogilvy

I don't think so, but what I was suggesting was that you provide the
interaction with the user. Get their selection from getopenfilename for
example. Then, unprotect, import and position the image, reprotect, i.e.
the code never quits to allow the user access to the sheet. So your
exposure would be minimal.

You may be able to use finer granularity in xl2002 or xl2003 ( I don't have
a copy handy/installed) but they offered much richer levels of protection.
But I doubt they leave the menus enabled - could be wrong however.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top