I have been trying to modify this script to take the pdf file and insert it as an image into the active worksheet. but it keeps creating a new workbook and inserting into the new book.
Can someone help me modify this script so it inserts the pdf as an image to the worksheet called "report".
Sub insert_pdf_to_report()
Dim Xl Dim Wb Dim Ws Dim Ol
Sheets("Report").Activate
Set Xl = CreateObject("Excel.Application")
Set Wb = Xl.Workbooks.Add
Set Ws = Wb.Worksheets.Add
Set Ol = Ws.OLEObjects.Add(, "C:\QGC_HSSE\template.pdf", True, False)
With Ol
.Left = Ws.Range("A1").Left
.Height = Ws.Range("A1").Height
.Width = Ws.Range("A1").Width
.Top = Ws.Range("A1").Top
End With
Sheets("Report").Activate
Xl.Visible = True
End Sub