A real puzzle?

P

paulsuk

I am looking for a way to embed a pdf in a worksheet at a specific point so
that the user can click on an icon and read the document but cannot
reposition the icon to another place in the worksheet. Every time the user
opens the worksheet I want him/her to find the icon where I put it and not
where he/she dragged it to last time. I suppose I am looking to associate
the icon/object with a
specified cell and allow the user to open it but not to move it to another
cell.
 
I

Ian

Just a guess, as I've no idea how or if it could be achieved.

Can you put a button on the sheet which opens the pdf embedded into another,
hidden sheet?

I assume it has to be embedded, but if you can get away with linking rather
than embedding, create a hyperlink to the file.
 
M

Mike

Simplest way is to protect the worksheet and not allow the user to edit
objects. If other cells can be edited then these would have to be left
unlocked.

Mike
 
B

Bernie Deitrick

Paul,

Something like this, where Object 1 is the container of the pdf file: This will line the object up
with cell C5 of sheet 1 - you could fire this macro from the workbook open event:

Sub Macro1()
With Sheets("Sheet1").Shapes("Object 1")
.Left = Range("C5").Left
.Top = Range("C5").Top
End With
End Sub

HTH,
Bernie
MS Excel MVP
 
P

paulsuk

Bernie

Thanks for that. I am sure it would work. Except we are way above my
knowledge level and I wouldn't know where to start!
--
paul


Bernie Deitrick said:
Paul,

Something like this, where Object 1 is the container of the pdf file: This will line the object up
with cell C5 of sheet 1 - you could fire this macro from the workbook open event:

Sub Macro1()
With Sheets("Sheet1").Shapes("Object 1")
.Left = Range("C5").Left
.Top = Range("C5").Top
End With
End Sub

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

Paul,

Select the pdf file, and look at the name box just above cell A1. It will show the object name.
Use that object name in place of "Object 1" in the code. Change the "Sheet1" to the name of the
sheet. Then place the code into a regular codemodule:

Sub PaulMacro()
With Sheets("Sheet1").Shapes("Object 1")
.Left = Range("C5").Left
.Top = Range("C5").Top
End With
End Sub

In the codemodule of the ThisWorkbook object, place this code:

Private Sub Workbook_Open()
PaulMacro
End Sub

Visit here for an introduction to macros:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

And here for an introduction to event code (the workbook open macro):
http://www.mvps.org/dmcritchie/excel/event.htm

HTH,
Bernie
MS Excel MVP


paulsuk said:
Bernie

Thanks for that. I am sure it would work. Except we are way above my
knowledge level and I wouldn't know where to start!
 
P

paulsuk

Bernie - you are a real star. Thanks for all the info. I will take it home
and study it carefully instead of watching the game tonight!

Thanks again
 
Top