opening pdf in pdf reader instead of WebBrowser control in userform

Jobinkrishna

New Member
Joined
Feb 29, 2016
Messages
2
Hi , I have a vba code to display pdf file in the web browser control when we click or select link from the listbox, its working fine with my pc but on another PC its automatically opening in “pdf adobe reader” instead of web browser. how can i change this to web browser? i cannot find the reason of this, please help!!

Code:
Private Sub ListBox1_Click()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
On Error Resume Next
Dim AA1, AA2 As Variant
AA1 = UserForm6.Frame1.ListBox1.Text
AA2 = “C:\PO_Pfile\Temp1\Temp12.pdf”
FileCopy AA1, AA2
WebBrowser1.Navigate (AA1)
Workbooks(“PO_SFile”).Sheets(“Sheet2”).Range(“AP2”) = AA1
End Sub
 
Last edited by a moderator:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You may need to call ShellExecute

Private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA"
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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