I'm using the
application.getopenfilename
method to browse and open a file. i then copy some data to another file. My problem is that I can't seem to close that same file I opened with the get mthod. i know how to use the
proceedure to close the active window, but the file I want to close is not active at the time it needs to be closed, and I'll never know the name of the file since people name their files differently.
Heres my basic code:
NewFN1 = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please Select Lock Detail Report")
If NewFN1 = False Then
' They pressed Cancel
MsgBox "Stopping, no file selected."
Exit Sub
Else
Workbooks.Open Filename:=NewFN1
End If
Sheets("DownLoadReports").Select
Cells.Select
Selection.Copy
Windows("monthly servicing prep.xls").Activate
Sheets("Sheet1").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
JS
Bookmarks