AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 2,072
- Office Version
- 2019
- 2010
- Platform
- Windows
I don't really understand what this does as stepping through shows no code, it just "happens"
In Excel 32bit
filename is "100_1829.JPG 1 6"
StrPtr(filename) is 1740372
FileSpec is "*.wav"
StrPtr(FileSpec) is 220909268
and MatchSpec=False
But Debug-Compile in 64bit highlights StrPtr and advises "Type mismatch"
The definition for PathMatchSpec shows
I had to change this to Private Declare PtrSafe Function...
Any help fixing this appreciated.
Code:
Private Function MatchSpec( _
filename As String, _
FileSpec As String) As Boolean
MatchSpec = PathMatchSpec(StrPtr(filename), StrPtr(FileSpec))
End Function
In Excel 32bit
filename is "100_1829.JPG 1 6"
StrPtr(filename) is 1740372
FileSpec is "*.wav"
StrPtr(FileSpec) is 220909268
and MatchSpec=False
But Debug-Compile in 64bit highlights StrPtr and advises "Type mismatch"
The definition for PathMatchSpec shows
Code:
Private Declare Function PathMatchSpec _
Lib "shlwapi" Alias "PathMatchSpecW" ( _
ByVal pszFileParam As Long, _
ByVal pszSpec As Long) As Long
Any help fixing this appreciated.