G
Guest
I'm trying to load a set of questions stored as a text file into a slide in
PowerPoint. I'm using the following code :-
Private Sub Showfiledialog()
'opens File Dialog Box & allows user to choose a file
Dim dlgOpen As FileDialog
Dim vrtSelectedItem As Variant
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = False
.Show
.InitialFileName = "c:\documents and Settings\administrator\*.*"
selectedfile = .SelectedItems.Item(1)
End With
Set dlgOpen = Nothing
End Sub
the problem is that this code also opens the application. I call this code
from a command button within PowerPoint. When the user clicks on the command
button it is intended that the text file loads into question boxes. All
works well except that the PowerPoint application also opens. I have to
minimise the application to continue with the test slide.
Any help - what am I doing wrong. I started of with a full head of hair and
now I'm nearly bald. Save my hair PLEASE.
Many thanks Tony
PowerPoint. I'm using the following code :-
Private Sub Showfiledialog()
'opens File Dialog Box & allows user to choose a file
Dim dlgOpen As FileDialog
Dim vrtSelectedItem As Variant
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = False
.Show
.InitialFileName = "c:\documents and Settings\administrator\*.*"
selectedfile = .SelectedItems.Item(1)
End With
Set dlgOpen = Nothing
End Sub
the problem is that this code also opens the application. I call this code
from a command button within PowerPoint. When the user clicks on the command
button it is intended that the text file loads into question boxes. All
works well except that the PowerPoint application also opens. I have to
minimise the application to continue with the test slide.
Any help - what am I doing wrong. I started of with a full head of hair and
now I'm nearly bald. Save my hair PLEASE.
Many thanks Tony