Solved

Create Windows Shortcut

Posted on 2002-05-17
6
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 51

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 51

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

756 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