cchris_uk
02-15-2008, 03:52 AM
Hi,
I am trying to open a 'open file' dialog window using vba, but the following code (found on this site) gives me a 'runtime error 438:'
Sub mmm()
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
MsgBox .SelectedItems(1)
End If
End With
End Sub
I looked in the Object Browser and could not see that application > filedialog listed; is this not available in Excel2000?
What I want to do is:
1. Open a filedialogue box so that the user can select a .xls workbook.
2. Import the 1st worksheet of that workbook as a worksheet called "raw_data"
Chris
I am trying to open a 'open file' dialog window using vba, but the following code (found on this site) gives me a 'runtime error 438:'
Sub mmm()
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
MsgBox .SelectedItems(1)
End If
End With
End Sub
I looked in the Object Browser and could not see that application > filedialog listed; is this not available in Excel2000?
What I want to do is:
1. Open a filedialogue box so that the user can select a .xls workbook.
2. Import the 1st worksheet of that workbook as a worksheet called "raw_data"
Chris