excel vba application help

Joined
Apr 10, 2008
Messages
1
Reaction score
0
i am writing an application in excel 2003 using vba where i have created a user form that will display images on the form. i want to have the user select a folder from the open dialog box where the image files will be located. i am able to display the first image using the following code.

With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = Application.DefaultFilePath & "\"
.Title = "Please choose the file for kappa study"
.Show
If .SelectedItems.Count = 0 Then
MsgBox "Cancelled"
Else
MsgBox .SelectedItems(1)
fileName = .SelectedItems(1) KappaForm.DefectImage.Picture = LoadPicture(fileName)
End If
End With

but i need to display the next image in the same folder when the user clicks the next button on the displayed form. my question is how do i display the next image in the same folder. the .selecteitems(1) selects only the first image and displays it. i have fileName declared as a public string variable.

all images i am displaying are in .jpg.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top