Link to home
Start Free TrialLog in
Avatar of Annmv888
Annmv888

asked on

Why do i get "Object reference not set to an instance of an object" error when using the Hyperlink property to open an Excel Worksheet in Access?

I created an Excel spreadsheet and saved it to the same folder as the Access database.  The spreadsheet has two sheets.  One called open and the other closed.  They both have the same six headings and nothing else.  I added a button to my database with a hyperlink to open the spreadsheet.  I am receiving the following message whenever I click the button:
Object reference not set to an instance of an object.

I have searched this problem but everything I find has to do with code someone has written and not the Hyperlink Address property I used.

I also did this for a Word document and it works fine.
Avatar of PatHartman
PatHartman
Flag of United States of America image

Try setting a reference to Microsoft Office xx.0  -- "xx" is the number for your version of Office.  There will be only one listed in the reference list if you have only one version of Office installes.

To set a reference, open any code module.  Go to Tools/References and scroll the list to pick the library you want.
Avatar of Annmv888
Annmv888

ASKER

I did check that as a solution to the problem prior to posting and there is one for both Office and Excel for object library 14.  Actually, there is one for Access and Outlook too.

There is nothing that lists Microsoft Office 14.0 by itself.
There is no reference listed or there is no reference available?  There should be one for just Office xx.x  It will contain the shared functions.
There is no reference listed for me to check.
This is what the reference looks like.  I have o365/Office 2016 installed so it is 16.0.
User generated image
That's the object library and I did mention that I had that checked in a previous comment but it still didn't work.   When you referenced "Microsoft Office xx.0  -- "xx" I thought this was something different.  I guess I'm being to literal.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.