Solved

Create Windows Shortcut

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

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 52

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

724 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