Forum

Update for use 64-b...
 
Notifications
Clear all

Update for use 64-bit systems

2 Posts
2 Users
0 Reactions
74 Views
(@bill-jone)
Posts: 28
Eminent Member
Topic starter
 

Hi,

Please can you help to solve this issue. see attached image.

Issue.png

Thanks;

Bill

 
Posted : 23/06/2020 8:40 am
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
 

Hi Bill,

you need to modify the declarations and data types as described in this article

https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/ptrsafe-keyword

Private Declare PtrSafe Function SHBrowseForFolder Lib "Shell32.dll" (bBrowse As BrowseInfo) As LongLong
Private Declare PtrSafe Function SHGetPathFromIDList Lib "Shell32.dll" (ByVal lItem As LongLong, ByVal sDir As String) As LongLong

But if you just want the user to choose a folder you can use Application.FileDialog

 

With Application.FileDialog(msoFileDialogFolderPicker)

If .Show = True Then

DestFolder = .SelectedItems(1)

Else

MsgBox "You must specify a folder to save the PDF into." & vbCrLf & vbCrLf & "Press OK to exit this macro.", vbCritical, "Must Specify Destination Folder"

Exit Sub

End If

End With

 

https://docs.microsoft.com/en-us/office/vba/api/excel.application.filedialog

Regards

Phil

 
Posted : 23/06/2020 8:59 pm
Share: