I am trying to add a logo from a bitmap file to an Excel report which is created using MS Access 2010.
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"
I have also tried to import the bimtap which is stored in table "Copyright" in field "logo" using
I use this succesfully to place logos on all PDF reports that are created but when I try to use this to export to Excel it fails with
"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
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"
Code:
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
Code:
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
Comment