View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default OPen and close file

Alvin,

Try the following code:


Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.xls),*.xls")
If FName < False Then
Workbooks.Open FName
ThisWorkbook.Close
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Alvin Hansen" wrote in
message
...
Hi!

Hope someone can help with a inputbox
there shall contain a file name, when click
i want to close the file I work with now, and
open the other file there are written in the inputbox.

Best regards alvin