Access 2010 VBA Set an attachement image into an excel cell

Eduardompm

New member
Local time
Today, 01:42
Joined
Dec 26, 2013
Messages
1
My form: "Dailyissue"
My attachement field: "Attachement_1"

I attached an image in Attachement_1, I want to set that image in a cell of excel using VBA. How can I do it? (I don't want to read the image from the PC, I want to use the attached image)

Best regards
 
Try the below code:
Code:
  Me.YourOLEUnboundControlName.SetFocus
  SendKeys "^c"
  Dim oExcel As Excel.Application
  Dim oWB As Workbook
  Set oExcel = New Excel.Application
  Set oWB = oExcel.Workbooks.Open("DriveAndPathToYourExcelFile\YourExcelFile.xls")
  'Like ("C:\Access programmer\test2003-1.xls")
  DoEvents
  oExcel.ActiveSheet.Paste '.SendKeys "^v"
  oExcel.Visible = True
  'oWB.SaveAs "C:\Access programmer\test2003-1Copy.xls"
  'oWB.Close
  'oExcel.Quit
 

Users who are viewing this thread

Back
Top Bottom