Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding picture to page setup
Hi,
I want to add a picture to the left hand header in Page setup. So far I have tried the code that adds a picture to a worksheet but that does not seem to work. .LeftHeader = .Shapes.AddPicture("C:\Documents and Settings\My Documents\Logo.jpeg", False, True, 10, 10, 70, 70) I note that there does not seem to be a method of manually adding a picture to the header so my guess is that it is just not possible, but would like confirmation either that my guess it correct or that there is a way to add a picture using VBZ. Regards DavidC |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding picture to page setup
David,
When I recorded a macro this is the information that I got when I put a picture in my header on the left side. I did this by going to viewHeader/Footer - then clicking on custom. Once I was there I hit the picture icon and let it place it in the left-hand side of the header. I hope that this will be of help to you. Below is the VBA code from the Macro Recorder, Cheers, Brian ActiveSheet.PageSetup.LeftHeaderPicture.Filename = _ "C:\Documents and Settings\myNameHere\Pictures\deer-1280-1024.jpg" With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "&G" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed End With End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding picture to page setup
Hi, Pelarian,
I should have mentioned that I am running Office 2000. Which version do you run, as I cannot see any picture Icon under headers, custom, so I suspect that it is only available in Exell 2003 Regards DavidC "Pelarian" wrote: David, When I recorded a macro this is the information that I got when I put a picture in my header on the left side. I did this by going to viewHeader/Footer - then clicking on custom. Once I was there I hit the picture icon and let it place it in the left-hand side of the header. I hope that this will be of help to you. Below is the VBA code from the Macro Recorder, Cheers, Brian ActiveSheet.PageSetup.LeftHeaderPicture.Filename = _ "C:\Documents and Settings\myNameHere\Pictures\deer-1280-1024.jpg" With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "&G" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed End With End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding picture to page setup
Sorry it took me so long to reply to you. I am running Office 2k3 both
at work and at home. so yes I can see this could be an issue. I did a little research on Google and found this information at http://www.exceltip.com/st/Adding_a_...ooter/202.html A really good place to look around and ask for assistance. I have also read one of their books and found their information on VBA in Excel invaluable. Below you will find an excert from the web page that I listed above. Also here is the text that I typed in to google.com to search for information on your question..."add a picture to Excel 2000 header". Hopefully this will help you out a little more that what I gave you before. {Quoted from ExcelTip.com} To add a picture (such as a company logo) to the header/ footer in Excel 97 and Excel 2000: 1. Select cell A1. 2. From the Insert menu, select Picture, and then select From File. 3. Select the picture you want, and click Insert. 4. Adjust the picture to the height and width of the row. 5. From the File menu, select Page Setup. 6. Select the Sheet tab. 7. Select Rows to repeat at top. 8. Select row 1, and then click OK. While doing these steps you should be able to AFTER doing them a time or three <grin be able to turn the macro recorder on and then after doing the steps be able to get the code from there. Feel free to send me an email (please look at my profile to retrieve the email address) Regards, Pelarian |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding picture to page setup
Hi,
Thanks for your help. I too found the references, and they are a work around. Basically it is using the ability to reproduce the first defined rows on each sheet. It is a form of header and will do the job. It does appear that the ability to ad a picture into the header itself is only available in versions later than 2000. Regards David "DavidC" wrote: Hi, I want to add a picture to the left hand header in Page setup. So far I have tried the code that adds a picture to a worksheet but that does not seem to work. .LeftHeader = .Shapes.AddPicture("C:\Documents and Settings\My Documents\Logo.jpeg", False, True, 10, 10, 70, 70) I note that there does not seem to be a method of manually adding a picture to the header so my guess is that it is just not possible, but would like confirmation either that my guess it correct or that there is a way to add a picture using VBZ. Regards DavidC |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Page layout - page setup - items disabled | Excel Discussion (Misc queries) | |||
FORMAT EXCEL WORKBOOK (PAGE SETUP) ALL AT ONCE INSTEAD OF BY PAGE | Excel Discussion (Misc queries) | |||
Page Setup when saving a worksheet as a web page | Excel Discussion (Misc queries) | |||
HOW DO I SETUP A PAGE IN EXCEL TO GIVE TOTALS TO ANOTHER PAGE | Excel Worksheet Functions | |||
Under Page Setup the page option of Ledger - for Office XP | Excel Discussion (Misc queries) |