Execute exe embedded in excel by passing parameters to the application

beedistinct

Board Regular
Joined
Jun 24, 2011
Messages
62
I'm using excel 2013 preview.
I need to embed this convert.exe (PDF to Text converter) in the excel file (as "Object 1" - done!) and then execute it via a VBA macro. I'm embedding it because I don't want to ship it separately with the excel file.
The code looks like below.

Code:
Private Sub Workbook_Open()
    Dim ws As Worksheet
    Dim oo As OLEObject
    
    Set ws = Sheets("Sheet1")
    Set oo = ws.OLEObjects("Object 1")
    
    If Not oo Is Nothing Then
        oo.Verb xlVerbPrimary
        Application.WindowState = xlMinimized
    End If
  
End Sub
There are 2 problems:
1. It opens a dialogue box asking me to run the application while I want it to run in the background.
2. I cannot figure a way to provide the pdf file path that it needs to convert to text
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top