I downloaded the Common Dialog from Microsoft. It's written for 32 bit. I added this to the code to make it work with 64 bit:
#If VBA7 Then 'use PtrSafe
Private Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#ElseIf Win64 Then 'need datatype LongPtr
Private Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As LongPtr
#Else '32-bit Office
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OpenFilename) As Long
#End If
When I use the LaunchCD command, it doesn't open the window to pick a file. It gives me an error saying that a file was not selected and deletes the field it was supposed to save the path to. Here's the code for the button:
Private Sub btnSelectPicture_Click()
SubjectPicture = LaunchCD(Me, "C:\Pictures")
UpdatePicture
End Sub
I'm not sure if I need an updated version of the Common Dialog or if there is another way to choose a file.