Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Create Shortcut from macro 1

Status
Not open for further replies.

Fr33dan

Programmer
Jun 28, 2007
79
US
Does anyone know of a method to create shortcuts from a macro? I've searched google to no avail.
 
Thx PHV, I've built a sub from what the FAQ but I get a object required error on the the red line:
Code:
Sub shortcut()
[COLOR=red]    Set oWshShell = WScript.CreateObject("WScript.Shell")[/color]
    Set oShortcut = oWshShell.CreateShortcut("C:\proto.ink")
    oShortcut.targetPath = "J:\Joseph\ConvertNominalData.xls"
    oShortcut.Save
End Sub
I should have noted in my original post that I'm running Excel 97
 
Set oWshShell = CreateObject("WScript.Shell")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok that was a stupid error on my part. Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top