G
Guest
I compiled a working dll with office XP developer (code below). It does the
following:
1) loads a folder picker dialog box.
2) I choose a folder and save it to a variable
3) when "OPEN" is clicked msgbox is generated
I am call this function via a custom menu item
Problem/Issue occurs when the if statement is being executed, Excel
hangs/stops responding. I think it has to do with the dialog being/not being
modal but there does not seem to be any way to change that. Also when the
diabox is ls loaded it does not get the focus. What is up with that?
Thanks in advance
Private Sub message()
MsgBox "Can you read this"
Dim DefaultDir As String
Set folder = Application.FileDialog(msoFileDialogFolderPicker)
If folder.Show <> 0 Then
DefaultDir = folder.SelectedItems.Item(1) & "\"
MsgBox "Default Dir is " & DefaultDir
ElseIf folder.Show = 0 Then
MsgBox "cancel button selected."
End If
End Sub
following:
1) loads a folder picker dialog box.
2) I choose a folder and save it to a variable
3) when "OPEN" is clicked msgbox is generated
I am call this function via a custom menu item
Problem/Issue occurs when the if statement is being executed, Excel
hangs/stops responding. I think it has to do with the dialog being/not being
modal but there does not seem to be any way to change that. Also when the
diabox is ls loaded it does not get the focus. What is up with that?
Thanks in advance
Private Sub message()
MsgBox "Can you read this"
Dim DefaultDir As String
Set folder = Application.FileDialog(msoFileDialogFolderPicker)
If folder.Show <> 0 Then
DefaultDir = folder.SelectedItems.Item(1) & "\"
MsgBox "Default Dir is " & DefaultDir
ElseIf folder.Show = 0 Then
MsgBox "cancel button selected."
End If
End Sub