Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing FileSystemObject

Status
Not open for further replies.

mrrrl

MIS
Dec 26, 2001
179
US
I am opening up a dir to list the files in a MSFlexGrid. Then I am selecting which photo to use, but when I click on the MSFlexGrid line to select the photo, I get an Open File error.

So how do I close the FileSystemObject?

Private Sub Command4_Click() 'Search photos

Dim FSO As FileSystemObject
Dim MyFolder As folder
Dim MyFile As File
Set FSO = New FileSystemObject
Set MyFolder = FSO.GetFolder("C:\Pictures\")
For Each MyFile In MyFolder.Files
MSFlexGrid2.AddItem "" & MyFile & vbTab
Next MyFile
Set FSO = Nothing

End Sub
 
What does the code look like in your flex grid click event?

I think you are having trouble opening your picture file not having problems with the FSO in the command button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top