LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Change jpeg Picture in LeftHeader

I have two option buttons on a sheet called "QUOTE". Each option button
represents a company. When their option button is selected I want there logo
to be in the header. How can I change the logo jpeg in the header using code
like I have below? I'm getting an error where objLogo is in all of the code.

Sub HeaderFooterChanger()

Dim objLogo As Variant
Dim strRightHeader As String
Dim strCenterFooter As String

Application.ScreenUpdating = False

With Sheets("QUOTE")

' which option button is true
' Constants Enumeration: xlOn = 1 and xlOff = -4146
Select Case xlOn

' Ad Tech
Case .OptionButtons("optAdTech").Value

objLogo = .PageSetup.LeftHeaderPicture = _
"\\cdc.gov\private\M131\iqz9\Ad Tech\Formetco Logo.jpg"

strRightHeader = "&""-,Bold""QUOTATION / SALES AGREEMENT" &
Chr(10) & _
"&""-,Regular""Ad-Tech International, Inc."
& Chr(10) & _
"2963 Pleasant Hill Road" & Chr(10) & _
"Duluth, GA 30096" & Chr(10) & _
"PH 770-209-9102, Fax 770-209-0465" &
Chr(10) & _
"&D"
strCenterFooter = "Ad-Tech International, Inc." & Chr(10) & _
"www.adtechintl.com"

' Formetco
Case .OptionButtons("optFormetco").Value

objLogo = .PageSetup.LeftHeaderPicture = _
"\\cdc.gov\private\M131\iqz9\Ad Tech\Formetco Logo.jpg"

strRightHeader = "&""-,Bold""QUOTATION / SALES AGREEMENT" &
Chr(10) & _
"&""-,Regular""Formetco" & Chr(10) & _
"2963 Pleasant Hill Road" & Chr(10) & _
"Duluth, GA 30096" & Chr(10) & _
"PH 1-800-Formetco, Fax ???-???-????" &
Chr(10) & _
"&D"
strCenterFooter = "Formetco" & Chr(10) & _
"www.formetco.com"
End Select

' change header/footer properties
With .PageSetup

' change logo
.LeftHeaderPicture = objLogo

' ensure header picture can be visible
.LeftHeader = "&G"

' change header/footer
.RightHeader = strRightHeader
.CenterFooter = strCenterFooter
End With
End With

Application.ScreenUpdating = True

End Sub
--
Cheers,
Ryan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jpeg links opening in Explorer instead of Picture Manager stripedfrog via OfficeKB.com Excel Worksheet Functions 0 March 25th 10 06:14 PM
JPEG picture looks fine but is distorted in print preview & printi SASgirl Excel Discussion (Misc queries) 0 September 3rd 08 04:17 PM
CenterHeader, RightHeader, LeftHeader Ross Culver[_2_] Excel Programming 1 October 12th 07 02:37 AM
CUT AND PASTE A .JPEG PICTURE TO EXCEL, THEN IT WONT PRINT Cjbrad Excel Discussion (Misc queries) 1 August 2nd 06 06:02 PM
jpeg picture always the same size Denny Excel Worksheet Functions 0 November 10th 04 04:00 AM


All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"