Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I'm creating a form which I will save as a protected template. How do I allow
users to insert their own logo in a designated area? Is this possible? I tried using the "image" control box field but I'm not sure if this is what it is intended for. Thanks |
#2
![]() |
|||
|
|||
![]()
I think I'd use a macro that asked for the logo, unprotected the worksheet,
added the logo and then reprotected the worksheet. Kind of... Option Explicit Sub testme() Dim myPictName As Variant Dim myPict As Picture Dim wks As Worksheet Set wks = Worksheets("sheet1") myPictName _ = Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif") If myPictName = False Then MsgBox "try later!" Exit Sub End If With wks .Unprotect Password:="hi" With .Range("a1:B9") Set myPict = .Parent.Pictures.Insert(myPictName) myPict.Top = .Top myPict.Left = .Left myPict.Width = .Width myPict.Height = .Height End With .Protect Password:="hi" End With End Sub And you could completely control where the logo went. Marissa wrote: I'm creating a form which I will save as a protected template. How do I allow users to insert their own logo in a designated area? Is this possible? I tried using the "image" control box field but I'm not sure if this is what it is intended for. Thanks -- Dave Peterson |
#3
![]() |
|||
|
|||
![]()
Dave,
That works great! Now, since I don't know ahead of time how big or small the logos could be, if I tell the macro to fit it within a certain range, it could get stretched out of proportion. I tried just referencing one cell as the starting point, but instead it squeezed or stretched the picture into that one cell. "Dave Peterson" wrote: I think I'd use a macro that asked for the logo, unprotected the worksheet, added the logo and then reprotected the worksheet. Kind of... Option Explicit Sub testme() Dim myPictName As Variant Dim myPict As Picture Dim wks As Worksheet Set wks = Worksheets("sheet1") myPictName _ = Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif") If myPictName = False Then MsgBox "try later!" Exit Sub End If With wks .Unprotect Password:="hi" With .Range("a1:B9") Set myPict = .Parent.Pictures.Insert(myPictName) myPict.Top = .Top myPict.Left = .Left myPict.Width = .Width myPict.Height = .Height End With .Protect Password:="hi" End With End Sub And you could completely control where the logo went. Marissa wrote: I'm creating a form which I will save as a protected template. How do I allow users to insert their own logo in a designated area? Is this possible? I tried using the "image" control box field but I'm not sure if this is what it is intended for. Thanks -- Dave Peterson |
#4
![]() |
|||
|
|||
![]()
Try commenting out these lines:
myPict.Width = .Width myPict.Height = .Height The logos will be their "natural" size. Marissa wrote: Dave, That works great! Now, since I don't know ahead of time how big or small the logos could be, if I tell the macro to fit it within a certain range, it could get stretched out of proportion. I tried just referencing one cell as the starting point, but instead it squeezed or stretched the picture into that one cell. "Dave Peterson" wrote: I think I'd use a macro that asked for the logo, unprotected the worksheet, added the logo and then reprotected the worksheet. Kind of... Option Explicit Sub testme() Dim myPictName As Variant Dim myPict As Picture Dim wks As Worksheet Set wks = Worksheets("sheet1") myPictName _ = Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif") If myPictName = False Then MsgBox "try later!" Exit Sub End If With wks .Unprotect Password:="hi" With .Range("a1:B9") Set myPict = .Parent.Pictures.Insert(myPictName) myPict.Top = .Top myPict.Left = .Left myPict.Width = .Width myPict.Height = .Height End With .Protect Password:="hi" End With End Sub And you could completely control where the logo went. Marissa wrote: I'm creating a form which I will save as a protected template. How do I allow users to insert their own logo in a designated area? Is this possible? I tried using the "image" control box field but I'm not sure if this is what it is intended for. Thanks -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to insert a picture in the Footer (not the Header) in Excel 20 | Excel Worksheet Functions | |||
insert picture | Excel Discussion (Misc queries) | |||
How do I insert a clip art picture into a text box in word 2003 | Excel Discussion (Misc queries) | |||
Challenging Charting | Charts and Charting in Excel | |||
how can I insert a picture conditional on another cell | Excel Worksheet Functions |