vick

need help to embed pdf in excel

10 posts in this topic

#1 ·  Posted

with below code i can embed pdf in excel but i want to add in particular cell let's say A1 not by size.

Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\Site List.xlsx")
$oExcel.ActiveSheet.OLEObjects.Add (Null, "C:\Users\patelvi.DIAGLABS\Desktop\1M1160054.pdf", False, _
                        True, "C:\Users\patelvi.DIAGLABS\Desktop\pdf2.ico", 0, "Document 1", _
                        0, 10, 10, 0).Select

 

can you help me how to embed in cell pls?

Share this post


Link to post
Share on other sites



#2 ·  Posted

Can you embed the PDF in cells by hand?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

yes i can select cell and insert file which will insert in cell .

Share this post


Link to post
Share on other sites

#4 ·  Posted

Can you please activate the macro recorder, embed the PDF and then post the resulting VBA.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

Sub Macro3()

' Macro3 Macro
    Range("D7").Select
    ActiveSheet.OLEObjects.Add(Filename:= _
        "C:\Users\patelvi.DIAGLABS\Desktop\1M1160054.pdf", Link:=False, _
        DisplayAsIcon:=True, IconFileName:= _
        "C:\windows\Installer\{AC76BA86-7AD7-1033-7B44-AC0F074E4100}\PDFFile_8.ico", _
        IconIndex:=0, IconLabel:="C:\Users\patelvi.DIAGLABS\Desktop\1M1160054.pdf") _
        .Select
End Sub

 

i think record is same what i did but i need to select first specific cell. how i can achieve it ?

Share this post


Link to post
Share on other sites

#6 ·  Posted

$oExcel.ActiveSheet.Range("D7").Select


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted

Ok got it. Basically almost same as vba.

thanks,

Share this post


Link to post
Share on other sites

#8 ·  Posted

The only difference is that AutoIt does not support named parameters.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#9 ·  Posted

thank you sir.

Share this post


Link to post
Share on other sites

#10 ·  Posted

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now