printobject for image objects

T

troy.scheh

I've got 3 signatures inserted into image objects. I have the visible
and printobjects options set to False in the properties dialog for all
3. I have a combo box linked to a cell S2 and a range of signature
names. I want the employee to pick his signature from the combo box,
and only his signature to print out, but still not be shown on the
sheet. here's what I've got and it just doesn't work. not stopping
the code or kicking errors, but not setting the printobject to true
either. Thanks in advance.

Public Sub signatures()

Sheet2.jessiedinsig.PrintObject = False
Sheet2.chriswinsig.PrintObject = False
Sheet2.davidshawsig.PrintObject = False

If Sheet2.Range("S2").Value = "Jessie Dinwiddie" Then
Sheet2.jessiedinsig.PrintObject = True
ElseIf Sheet2.Range("S2").Value = "David Shaw" Then
Sheet2.davidshawsig.PrintObject = True
ElseIf Sheet2.Range("S2").Value = "Christopher Winlock" Then
Sheet2.chriswinsig.PrintObject = True
End If

End Sub

Private Sub SigInspect_Change()

Sheet2.signatures

End Sub
 
T

troy.scheh

Update:

If i change the combo box, and then toggle to design mode and then go
to print preview, the correct signature image shows up. when i toggle
back out of design mode, it goes away. so, the code works, but only in
design mode. what am i missing?
 
T

troy.scheh

Solution:

For some reason, you have to have the visible property set to true as
well. this is why the design mode print preview worked and the regular
mode didn't. when you're in design mode, it overrides all visible
settings and sets them to true. when you leave design mode, they go
back to the set value. it seems silly to me that both visible and
printobject have to be set to true, but that's the way i got it to
work. here's the new code:

Public Sub signatures()

Sheet2.jessiedinsig.PrintObject = False
Sheet2.chriswinsig.PrintObject = False
Sheet2.davidshawsig.PrintObject = False
Sheet2.jessiedinsig.Visible = False
Sheet2.chriswinsig.Visible = False
Sheet2.davidshawsig.Visible = False

If Sheet2.Range("S2").Value = "Jessie Dinwiddie" Then
Sheet2.jessiedinsig.PrintObject = True
Sheet2.jessiedinsig.Visible = True
ElseIf Sheet2.Range("S2").Value = "David Shaw" Then
Sheet2.davidshawsig.PrintObject = True
Sheet2.davidshawsig.Visible = True
ElseIf Sheet2.Range("S2").Value = "Christopher Winlock" Then
Sheet2.chriswinsig.PrintObject = True
Sheet2.chriswinsig.Visible = True
End If

End Sub

Private Sub SigInspect_Change()

Sheet2.signatures

End Sub
 

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