ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   printobject for image objects (https://www.excelbanter.com/excel-worksheet-functions/15542-printobject-image-objects.html)

[email protected]

printobject for image objects
 
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


[email protected]

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?


wrote:
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



[email protected]

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




wrote:
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




All times are GMT +1. The time now is 12:45 PM.

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