Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Running a shortcut

how do I run a .lnk file from VBA? I have tried the shell command but with no success. Any help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Running a shortcut

Something like this may work for you:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub a()
ShellExecute 0, "open", "C:\MyLink.lnk", "", "c:\", 1
End Sub


--
Jim Rech
Excel MVP
"Newbie" wrote in message
...
| how do I run a .lnk file from VBA? I have tried the shell command but
with no success. Any help appreciated.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
shortcut has change or move so this shortcut can not open bakerstreet Excel Worksheet Functions 2 April 2nd 10 01:21 PM
Shortcut key not running macro properly Ted M H Excel Discussion (Misc queries) 5 October 1st 08 11:07 PM
Shortcut to : key Margaret RM Excel Discussion (Misc queries) 4 July 12th 07 03:27 AM
shortcut key not not running macro's all of a sudden Todd Excel Programming 1 November 11th 03 08:19 PM
Running a macro from a desktop icon shortcut Sofia Excel Programming 2 July 15th 03 08:01 PM


All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"