G
Gamini Jayarathne
Hi ,
I am creating a COM Add-in using VBA Add-in designer. I have created a user
form to get some custom properties of a shape. In there I am trying to use
the FileDialog object to a File name as a property. The following code does
not work as expected.
The Error I get is " Invalid use of Property". But all the code samples
given are same as mine. Is it somthing that I haven't set a particular
refernce????
Private Sub cmdBrowse_Click()
Dim fd As Office.FileDialog
Dim vrtSelectedItem As Variant
fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Set txtURL.Value = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
I am creating a COM Add-in using VBA Add-in designer. I have created a user
form to get some custom properties of a shape. In there I am trying to use
the FileDialog object to a File name as a property. The following code does
not work as expected.
The Error I get is " Invalid use of Property". But all the code samples
given are same as mine. Is it somthing that I haven't set a particular
refernce????
Private Sub cmdBrowse_Click()
Dim fd As Office.FileDialog
Dim vrtSelectedItem As Variant
fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Set txtURL.Value = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub