This code works, but it inserts the bitmap as a linked file. So when I view the excel file on another workstation which does not have the bitmap, the logo is shown with the message "The Linked Image cannot be displayed"
Expand|Select|Wrap|Line Numbers
- Dim xlApp As Excel.Application
- Dim xlBook As Excel.Workbook
- Dim xlSheet As Excel.Worksheet
- Dim PicLocation As String
- Dim myPict As Excel.Picture
- Set xlApp = CreateObject("Excel.Application")
- Set xlBook = xlApp.Workbooks.Add
- xlBook.Application.Visible = True
- Set xlSheet = xlBook.Worksheets.Add
- xlSheet.Name = "Invoices Totals"
- xlSheet.Activate
- PicLocation = "C:\foldername\picture1.bmp"
- If Dir(PicLocation) <> "" Then
- With xlSheet.Range("L1")
- Set myPict = .Parent.Pictures.Insert(PicLocation)
- myPict.Top = .Top
- myPict.Left = .Left
- myPict.Placement = xlMoveAndSize
- End With
- End If
Expand|Select|Wrap|Line Numbers
- PicLocation = DLookup("logo", "copyright")
"Unable to get the Insert property of the picture class"
Any suggestions on how to make this an embedded image on the Excel file would be gratefully recieved, by whichever method.
Regards
Keith