Hyperlink to open an embedded file

tstout1000

New Member
Joined
Jan 26, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have been searching everwhere for VBA copde to allow a user to click on different hyperlinks in one tab that will open specific embedded pdfs that I have stored in another sheet. The application is to be able to click on a part number that has the hyperlink and open the speicifc spec sheet pdf which i have embedded in another. I found code from 2004, but it crashes every time. Below is the code. It jumps to the tab with all the embedded pdf but doesn't open the pdf. It bombs on the sceond line. Object 0128 is the name box of the specific embedded pdf. Any help would be great.

Private Sub Worksheet_Activate()
ActiveSheet.Shapes("Object 0128").Select
Selection.Verb Verb:=xlVerbOpen
End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
I tried fiddling with the code on Mr Excel that is HERE (which may be the same as the code that you are using) but it is flaky. Behavior varies. Sometimes Adobe opens with no doc. Sometimes after opening the doc Adobe crashes. Sometimes The worksheet is in front of the PDF. Sometimes Excel cannot find the PDF program. 80% of the time it seems to work. Not acceptable.

There does seem to be a good alternative. I have Office 365. It comes with some 1Drive space, 1 GB I think. Anyway, I created a link in an Excel cell that opens a file on 1Drive. (It opens in the browser). Works well. So might you be able to store spec sheets on 1Drive or Dropbox (free) etc. then put links to those files in the workbook for user. That seems better in that you don't need to update workbook's embedded pdfs and change the WorksheetChange event if you have to add another pdf to the list. You upload the file then create a link to it in Excel.
 
Upvote 0
I tried fiddling with the code on Mr Excel that is HERE (which may be the same as the code that you are using) but it is flaky. Behavior varies. Sometimes Adobe opens with no doc. Sometimes after opening the doc Adobe crashes. Sometimes The worksheet is in front of the PDF. Sometimes Excel cannot find the PDF program. 80% of the time it seems to work. Not acceptable.

There does seem to be a good alternative. I have Office 365. It comes with some 1Drive space, 1 GB I think. Anyway, I created a link in an Excel cell that opens a file on 1Drive. (It opens in the browser). Works well. So might you be able to store spec sheets on 1Drive or Dropbox (free) etc. then put links to those files in the workbook for user. That seems better in that you don't need to update workbook's embedded pdfs and change the WorksheetChange event if you have to add another pdf to the list. You upload the file then create a link to it in Excel.
Thanks OAkalnd Jim. That does work but not exactly what I need. I am sharing my file with others who may not have acces to my 1drive. So, I was hoping to have everything self contained. Orginally, I tried just linking to the web location via a hyperlink, but many of the various companies change the path and I would get a 404 message. I could add a picture of the pdf spec on mouse hover using the Note. But it takes several steps to add a lot of docs and the resolustion may not be readable, easily. I'll keep searching and trying. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

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