Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with converting a block of cells with Absolute and mixed references to relative references | Excel Worksheet Functions | |||
ActiveX Controls vs Form Controls | Excel Discussion (Misc queries) | |||
Modify Paste Special to choose absolute or relative references | Excel Programming | |||
Event procedures for controls added with Controls.Add | Excel Programming | |||
UserForm Controls References | Excel Programming |