Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default special folders: references for Shell Controls

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default special folders: references for Shell Controls

Const wsh_SPECIAL_FOLDER_DESKTOP = 10
Const wsh_SPECIAL_FOLDER_MY_DOCS As Long = 16
Dim oWSH As Object

Set oWSH = CreateObject("WScript.Shell")

MsgBox oWSH.SpecialFolders(wsh_SPECIAL_FOLDER_DESKTOP)

MsgBox oWSH.SpecialFolders(wsh_SPECIAL_FOLDER_MY_DOCS)


--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Allen_N" wrote in message
...
I tried to implement the example in

'http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_higv.mspx?mfr=t
rue
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/pl
atform/shell/programmersguide/shell_basics/shell_basics_programming/objectma
p.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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
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?


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
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Modify Paste Special to choose absolute or relative references peterl Excel Programming 1 December 30th 05 12:04 AM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM
UserForm Controls References Nigel[_4_] Excel Programming 2 October 4th 03 01:55 PM


All times are GMT +1. The time now is 09:03 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"