Solved

Create Windows Shortcut

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

911 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

17 Experts available now in Live!

Get 1:1 Help Now