Solved

Create Windows Shortcut

Posted on 2002-05-17
6
197 Views
Last Modified: 2007-12-19
From within Access 2000, I am trying to create a Windows shortcut from a file I specify...

ie..   With file         abc.txt    located in C:\Temp
       Create Shortcut   abc.lnk    located in D:\MyFiles


I have got this to work every now and then using  

Dim wshShell As Object
Set wshShell = CreateObject("WScript.Shell")
Dim lnkDesktop As Object
Set lnkDesktop = wshShell.CreateShortcut(D:\MyFiles\abc.lnk")
With lnkDesktop
   .TargetPath = "C:\Temp\abc.txt"
         .WorkingDirectory = "C:\Temp"
         .Save
    End With
       Set lnkDesktop = Nothing
       Set wshShell = Nothing


As shown in this answer...
http://www.experts-exchange.com/questions/Q.20224167.html

but every now and then, on an infrequent basis,  I get a run-time error stating the following...

Run-time Error -2147024769(8007007f)
Automation Error
The specified procedure can not be found

I think this might be a reference problem, however, as it runs every now and then... I'm not quite sure what is going on....

Any help would be appreciated...

Thanks in advance
0
Comment
Question by:Melijane
6 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7015796
0
 

Author Comment

by:Melijane
ID: 7020632
Unfortunately these didn't help... They are more for moving shortcut files rather than creating shortcut files....
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7023390
Hi,

Sorry for late reply:

Go to your Project reference to add the M$ Script Languange Library. And see how if the problem solved.

* the actually library name may be different, sorry as here don't have VB installed.

regards
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7222110

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7240599
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question