Create a shortcut to a folder with VBA

O

Otto Moehrbach

Excel XP & Win XP
I found some code in the site below that creates a desktop shortcut to the
active file. It works well. But what I want to do is place, on the
desktop, a shortcut to a folder, not to a file. Can anyone help me to
modify this code, or create new code to create a shortcut to a folder and
place the shortcut on the desktop? Thanks for your time. Otto

http://www.vba-programmer.com/Snippets/Code_VB/Shortcut_Creation.html
 
T

Tom Ogilvy

Dir you try changing

lsPath = Application.Path & "\" & Application.Name'

to

lsPath = "C:\Myfolder\MySubFolder"
 
O

Otto Moehrbach

Thanks Tom. I'll try it in the morning. Otto
Tom Ogilvy said:
Dir you try changing

lsPath = Application.Path & "\" & Application.Name'

to

lsPath = "C:\Myfolder\MySubFolder"
 
O

Otto Moehrbach

That worked great. Thanks again. Otto
Tom Ogilvy said:
Dir you try changing

lsPath = Application.Path & "\" & Application.Name'

to

lsPath = "C:\Myfolder\MySubFolder"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top