View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default special folders: references for Shell Controls

Maybe this will help

Sub GetSpecialFolder()
'Special folders are : AllUsersDesktop, AllUsersStartMenu
'AllUsersPrograms, AllUsersStartup, Desktop, Favorites
'Fonts, MyDocuments, NetHood, PrintHood, Programs, Recent
'SendTo, StartMenu, Startup, Templates

'Get Favorites folder and open it
Dim WshShell As Object
Dim SpecialPath As String

Set WshShell = CreateObject("WScript.Shell")
SpecialPath = WshShell.SpecialFolders("Favorites")
MsgBox SpecialPath
'Open folder in Explorer
Shell "explorer.exe " & SpecialPath, vbNormalFocus
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Allen_N" wrote in message ...
I tried to implement the example in
'http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_higv.mspx?mfr=true
to get the 'My Documents' and 'Desktop' folders, but Excel doesn't like the
'.Self' property of the 'Folder' object.

The references to add were given in
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/objectmap.asp'
as:

Microsoft Internet Controls (SHDocVw)
Microsoft Shell Controls and Automation (Shell32)

but the 1st one isn't listed in the available references in my Excel 2003,
and adding the 2nd reference didn't fix my problem.

Does anyone know what these references should be for Windows XP?