Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Again
I have opened a file successfully (user defined and stored as FileToOpen) and copied it's content into the active worksheet. However, since it opens a new instance of Excel, I can't work out how to close the FileToOpen file, and where the command belongs in the code below. ----------------------------------------------------------------------------- Worksheets("Imported Data").Visible = True With Application.FileDialog(msoFileDialogOpen) FileToOpen = Application _ .GetOpenFilename("Comma Separated Values (*.csv),*.csv,Microsoft Excel (*.xls),*.xls,All Files (*.*),*.*") Workbooks.Open FileToOpen Range("A1").Activate Application.Run ("'Report Generator v1.xls'!Select_Data") Selection.Copy Workbooks("'Report Generator v1.xls").Activate Sheets("Imported Data").Activate Range("A1").Select Selection.Insert Shift:=xlDown ***I assume here I need to switch to the other workbook (FileToOpen), close it, then switch back to ("Report Generator v1.xls")*** End With Worksheets("Imported Data").Visible = False Sheets("Main").Activate |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing a workbook after it has opened another | Excel Programming | |||
Closing files and saving files | Excel Worksheet Functions | |||
Opened Autosave but when closing workbook Autosave closes itself | Excel Worksheet Functions | |||
Excel 2003 when closing Excel after having opened a project locked for viewing.. password prompt??? | Excel Discussion (Misc queries) | |||
closing opened workbook/app in memory | Excel Programming |