Solved

Create Windows Shortcut

Posted on 2002-05-17
6
194 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 49

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 49

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now