ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert picture into protected sheet (https://www.excelbanter.com/excel-programming/371948-insert-picture-into-protected-sheet.html)

ZipCurs

Insert picture into protected sheet
 
I would like to insert a picture from file into a protected worksheet. At
this point, the Excel pull down menus are greyed out for this feature as long
as the sheet is protected. As far as the user is concered, I want to keep
the sheet protected.

I am looking for a simple solution to allow the insertion of a picture. If
this does not work, I will most likely resort to creating a macro with a
button for picture insertion.

Thanks for the help in advance.

Allllen

Insert picture into protected sheet
 
You can unprotect it and then protect it again within your code.

ActiveSheet.Protect Password:="fish"

'your code to insert picture, will be something like this but you may also
want to resize or reposition it

ActiveSheet.Pictures.Insert("C:\mypic.jpg")

ActiveSheet.Unprotect Password:="fish"


if screen flickering is a problem, use
application.screenupdating = false before your code AND
application.screenupdating = true after it

HTH
--
Allllen


"ZipCurs" wrote:

I would like to insert a picture from file into a protected worksheet. At
this point, the Excel pull down menus are greyed out for this feature as long
as the sheet is protected. As far as the user is concered, I want to keep
the sheet protected.

I am looking for a simple solution to allow the insertion of a picture. If
this does not work, I will most likely resort to creating a macro with a
button for picture insertion.

Thanks for the help in advance.


ZipCurs

Insert picture into protected sheet
 
Thanks for the quick response. I understand the approach that you are
recommending, but was hoping for a simpler approach. My real question is: Is
it impossible to insert a picture into a protected worksheet? If not, how do
you do it?

"Allllen" wrote:

You can unprotect it and then protect it again within your code.

ActiveSheet.Protect Password:="fish"

'your code to insert picture, will be something like this but you may also
want to resize or reposition it

ActiveSheet.Pictures.Insert("C:\mypic.jpg")

ActiveSheet.Unprotect Password:="fish"


if screen flickering is a problem, use
application.screenupdating = false before your code AND
application.screenupdating = true after it

HTH
--
Allllen


"ZipCurs" wrote:

I would like to insert a picture from file into a protected worksheet. At
this point, the Excel pull down menus are greyed out for this feature as long
as the sheet is protected. As far as the user is concered, I want to keep
the sheet protected.

I am looking for a simple solution to allow the insertion of a picture. If
this does not work, I will most likely resort to creating a macro with a
button for picture insertion.

Thanks for the help in advance.


Tom Ogilvy

Insert picture into protected sheet
 
yes, but . . .

Work around 1.

when you protect the sheet, only protect contents.

Insert the picture to another unprotected sheet, then copy and paste it to
your protected sheet.

work around 2
s = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample
Pictures\Blue Hills.jpg"
ActiveSheet.Protect Password:="ABC", UserInterfaceOnly:=True
ActiveSheet.Pictures.Insert (s)

You only need to set the UserInterfaceOnly property once as long as the
worksheet stays protected. It can only be set with code and it has to be
done whenever the workbook is opened

Work around 3
You received that help

--
Regards,
Tom Ogilvy




"ZipCurs" wrote in message
...
Thanks for the quick response. I understand the approach that you are
recommending, but was hoping for a simpler approach. My real question is:
Is
it impossible to insert a picture into a protected worksheet? If not, how
do
you do it?

"Allllen" wrote:

You can unprotect it and then protect it again within your code.

ActiveSheet.Protect Password:="fish"

'your code to insert picture, will be something like this but you may
also
want to resize or reposition it

ActiveSheet.Pictures.Insert("C:\mypic.jpg")

ActiveSheet.Unprotect Password:="fish"


if screen flickering is a problem, use
application.screenupdating = false before your code AND
application.screenupdating = true after it

HTH
--
Allllen


"ZipCurs" wrote:

I would like to insert a picture from file into a protected worksheet.
At
this point, the Excel pull down menus are greyed out for this feature
as long
as the sheet is protected. As far as the user is concered, I want to
keep
the sheet protected.

I am looking for a simple solution to allow the insertion of a picture.
If
this does not work, I will most likely resort to creating a macro with
a
button for picture insertion.

Thanks for the help in advance.




ZipCurs

Insert picture into protected sheet
 
Thanks, I think a combination of the three may work for me.

"Tom Ogilvy" wrote:

yes, but . . .

Work around 1.

when you protect the sheet, only protect contents.

Insert the picture to another unprotected sheet, then copy and paste it to
your protected sheet.

work around 2
s = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample
Pictures\Blue Hills.jpg"
ActiveSheet.Protect Password:="ABC", UserInterfaceOnly:=True
ActiveSheet.Pictures.Insert (s)

You only need to set the UserInterfaceOnly property once as long as the
worksheet stays protected. It can only be set with code and it has to be
done whenever the workbook is opened

Work around 3
You received that help

--
Regards,
Tom Ogilvy




"ZipCurs" wrote in message
...
Thanks for the quick response. I understand the approach that you are
recommending, but was hoping for a simpler approach. My real question is:
Is
it impossible to insert a picture into a protected worksheet? If not, how
do
you do it?

"Allllen" wrote:

You can unprotect it and then protect it again within your code.

ActiveSheet.Protect Password:="fish"

'your code to insert picture, will be something like this but you may
also
want to resize or reposition it

ActiveSheet.Pictures.Insert("C:\mypic.jpg")

ActiveSheet.Unprotect Password:="fish"


if screen flickering is a problem, use
application.screenupdating = false before your code AND
application.screenupdating = true after it

HTH
--
Allllen


"ZipCurs" wrote:

I would like to insert a picture from file into a protected worksheet.
At
this point, the Excel pull down menus are greyed out for this feature
as long
as the sheet is protected. As far as the user is concered, I want to
keep
the sheet protected.

I am looking for a simple solution to allow the insertion of a picture.
If
this does not work, I will most likely resort to creating a macro with
a
button for picture insertion.

Thanks for the help in advance.






All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com