Link specification does not exist

BrianMH

Well-known Member
Joined
Mar 26, 2008
Messages
1,490
Hi all,

Got a strange one here. Hopefully someone has seen it before and can help me out. I have some code that runs on startup of a database. It always errors saying that a link specification does not exist. Oddly if I end the code from the debug prompt and run it again it runs just fine. It only seems to fail when trying to execute from a startup form or an autoexec macro.

Any ideas?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Do you contain any linked objects in your database (tables/queries)?
If so, the link on one or more of them may not be valid (perhaps the source was moved or deleted).
It is possible to have a linked object that is not being used, so it might return an error if the link is bad, but since it is not being used, it may not affect the outcome of your AutoExec macro.
 
Upvote 0
There is 1 linked table. It has a valid link specification and it is the only table in the database.

When I start up the autoexec macro or have a start form with code in the load event it fails saying the link specification does not exist. However if I then hit end on the debug prompt and run the code again it works. It also works if I hold shift to stop the code running on open and then I run the code manually.

It is almost as if the link specification isn't loading in time. I tried to set a timer on it to pause it and even added a doevents so that it could update and this didn't work either. I want to be able to set this as a scheduled task so this is driving me insane.

FYI I've now posted this on VBAX also.

http://www.vbaexpress.com/forum/sho...cification-does-not-exist&p=296461#post296461
 
Last edited:
Upvote 0
Upvote 0
I have used them lots also. It is linked to a csv file. All it really is doing is running a query (based on the text file), exporting it and attaching it to an email. It does a dcount to see if it needs to send an email or not (early on in the code) and it is on the dcount where it fails until I stop the code and rerun it.
 
Upvote 0
It is a select query. I've solved it now. I tried it on another computer and it worked fine so I ran a repair and remembered the computer it ran on I had installed 2007 SP3 so I did the same on the original computer. Not sure if it was the repair or the service pack but it is working now.

Funny how we assume something is wrong with the code when it doesn't work when it could be the installation itself.
 
Upvote 0
Glad you were able to figure it out!
 
Upvote 0

Forum statistics

Threads
1,215,373
Messages
6,124,548
Members
449,170
Latest member
Gkiller

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