Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Data value display attributes linked to table attributes MDT at Paragon Home Inspections, LLC Charts and Charting in Excel 0 November 15th 06 12:53 AM
Shortcut Attributes jdawson[_2_] Excel Programming 0 May 25th 06 01:23 PM
can i create a shortcut to open a spreadsheet read only? Mark Excel Discussion (Misc queries) 1 September 21st 05 01:13 PM
Filesystem again Alvin Hansen[_2_] Excel Programming 1 February 16th 05 10:31 PM
Filesystem again Alvin Hansen[_2_] Excel Programming 3 January 31st 05 07:55 PM


All times are GMT +1. The time now is 11:41 AM.

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

About Us

"It's about Microsoft Excel"