J
Jacob Patzer
ok here's a question for all of you VBA Gurus out there. Havent found
anyone to be able to tell me if this is a problem. Am running XPhome
completely upgraded with office 2000 premium.....and have written a
short routine in VBA WHICH runs on 98 machines. AM getting a run time
error 453 that something is wrong with the shell32.dll on the xp
machine. Have looked and the dll is there 7.80 mb...... following the
code:
-----------------------------------------------------------------------------
Option Explicit
Public Type BROWSEINFO
h0wner As Long
pidlroot As Long
pszDisplayName As String
lpszTitle As String
ulflags As Long
lpfn As Long
lparam As Long
iimage As Long
End Type
Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _
ByVal pszPath As String) As Long
Declare Function SHBrowserForFolder Lib "shell32.dll" _
Alias "SHBrowserForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
---------------------------------------------------------------------
Function dirauswahl()
Dim msg As String
msg = "choose a folder"
dirauswahl = getdirectory(msg)
End Function
---------------------------------------------------------------------
Function getdirectory(Optional msg) As String
Dim BINFO As BROWSEINFO
Dim path As String
Dim r As Long, x As Long, pos As Integer
BINFO.pidlroot = 0&
If IsMissing(msg) Then
BINFO.lpszTitle = "choose a folder"
Else
BINFO.lpszTitle = msg
End If
BINFO.ulflags = &H1
----> x = SHBrowserForFolder(BINFO)
path = Space$(512)
r = SHGetPathFromIDList(ByVal x, ByVal path)
If r Then
pos = InStr(path, Chr$(0))
getdirectory = Left(path, pos - 1)
Else
getdirectory = ""
End If
End Function
anyone to be able to tell me if this is a problem. Am running XPhome
completely upgraded with office 2000 premium.....and have written a
short routine in VBA WHICH runs on 98 machines. AM getting a run time
error 453 that something is wrong with the shell32.dll on the xp
machine. Have looked and the dll is there 7.80 mb...... following the
code:
-----------------------------------------------------------------------------
Option Explicit
Public Type BROWSEINFO
h0wner As Long
pidlroot As Long
pszDisplayName As String
lpszTitle As String
ulflags As Long
lpfn As Long
lparam As Long
iimage As Long
End Type
Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _
ByVal pszPath As String) As Long
Declare Function SHBrowserForFolder Lib "shell32.dll" _
Alias "SHBrowserForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
---------------------------------------------------------------------
Function dirauswahl()
Dim msg As String
msg = "choose a folder"
dirauswahl = getdirectory(msg)
End Function
---------------------------------------------------------------------
Function getdirectory(Optional msg) As String
Dim BINFO As BROWSEINFO
Dim path As String
Dim r As Long, x As Long, pos As Integer
BINFO.pidlroot = 0&
If IsMissing(msg) Then
BINFO.lpszTitle = "choose a folder"
Else
BINFO.lpszTitle = msg
End If
BINFO.ulflags = &H1
----> x = SHBrowserForFolder(BINFO)
path = Space$(512)
r = SHGetPathFromIDList(ByVal x, ByVal path)
If r Then
pos = InStr(path, Chr$(0))
getdirectory = Left(path, pos - 1)
Else
getdirectory = ""
End If
End Function