Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to read filesystem shortcut attributes
I would like Excel to read the attributes of a file system shortcut and see what folder or file that the shortcut points to. I posted a similar question several weeks earlier and had no responses. If anyone can help, thanks. -- jdawson ------------------------------------------------------------------------ jdawson's Profile: http://www.excelforum.com/member.php...o&userid=32198 View this thread: http://www.excelforum.com/showthread...hreadid=552398 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to read filesystem shortcut attributes
"jdawson" wrote in message ... : : I would like Excel to read the attributes of a file system shortcut and : see what folder or file that the shortcut points to. : Here is a quick version for .lnk files, it would need to be modified slightly for .url links I hardcoded in a shortcut from my desktop to the ShortcutPath variable, replace it with the shortcut you are using. I also used late binding for reference compatibility, you could early bind it and set a reference to Windows Script Host Object Model. Public Sub ShortcutTarget() Dim Shell As Object Dim ShortcutPath As String Dim FileShortcut As Object Set Shell = CreateObject("WScript.Shell") ShortcutPath = "C:\Documents and Settings\pauld\Desktop\fastener.xls.lnk" Set FileShortcut = Shell.CreateShortcut(ShortcutPath) MsgBox FileShortcut.TargetPath End Sub Paul D |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to read filesystem shortcut attributes
Thank you very much. It looks great. :) I will give it a try. -- jdawson ------------------------------------------------------------------------ jdawson's Profile: http://www.excelforum.com/member.php...o&userid=32198 View this thread: http://www.excelforum.com/showthread...hreadid=552398 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data value display attributes linked to table attributes | Charts and Charting in Excel | |||
Shortcut Attributes | Excel Programming | |||
can i create a shortcut to open a spreadsheet read only? | Excel Discussion (Misc queries) | |||
Filesystem again | Excel Programming | |||
Filesystem again | Excel Programming |