I can insert picture to the header of my excel sheet using the below codes
VB Code:
Dim oSW As Excel.Worksheet
'Add picture at left header
Set oSW = Worksheets(1)
With oSW.PageSetup.LeftHeaderPicture
.FileName = (App.Path & "/Pic.jpg")
.Height = 50
End with
But the problem is my data on the excel sheet will cover part of the picture in the header. (See attached image)Why is this so that data can be mixed with header of the worksheet? any solutions?
Last edited by yanty; Feb 21st, 2006 at 04:24 AM.
I think I'm starting to like programming, but I'm still far from good
I just found one problem. When i click on the button that exports my database data to excel, it worked at first. Excel opens and data from database is exported, even the header works. But if I close the excel sheet and click on the button again, error occurs and points to Set oSW = Worksheets(1)
The notice state "Method 'Worksheets' of object '_Global' failed". Did I set teh oSW wrongly?
I think I'm starting to like programming, but I'm still far from good