VBA Code to Open Adobe File with Wildcards in String

Gtabtr1

New Member
Joined
Feb 15, 2017
Messages
39
HI there,
Here is my code:
Sub Open_CAReport()
Dim FANum As Variant
FANum = ActiveWorkbook.ActiveSheet.Range("B2").Value
Dim Analytics As String
Analytics = "X:\abt\ABTP\Programs\ABTP_Reports\ABTP_Analytics\@2018 Client Analytics_US"
Dim effmon As String
effmon = MonthName(month(Range("I2")), True)
Dim effnum As Variant
effnum = month(Range("I2"))

Dim AdobeApp As String
Dim AdobeFile As String
Dim StartAdobe As Long

AdobeApp = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"
AdobeFile = Analytics & effnum & " " & effmon & " 2018\*" & FANum & "*.pdf"
StartAdobe = Shell("" & AdobeApp & " " & AdobeFile & "", 1)
End Sub

I'm getting a "Run-time error '53': File not found" error and I think it may be because of the wildcards in the file name but I could be wrong.

Does anyone see anything wrong that would prevent the Adobe file from opening?

Thank you in advance for your help!!!!

 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,225,739
Messages
6,186,746
Members
453,370
Latest member
juliewar

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