Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File does not open/copy
I am using Excel 2000.
I have an Excel file open. Using a macro, I am opening another Excel file and then copying the first sheet from that file to a sheet in the original file. Everything works fine after a file has been copied once. Problem: The first file to copy will not copy. The macro must be run twice to work. It works fine for all file after that. Here is part of the code I am using: ................... Dim Current_Sheet As String, Current_Cell As String Current_Sheet = ActiveSheet.Name Current_Cell = ActiveCell.Address Sheets(1).Select Application.DisplayAlerts = False Dim Temp_name As Variant, Newbook As Variant, fname As Variant, Book As Variant Temp_name = ActiveWorkbook.Name Dim FileName As String Dim PathName As Variant 'Key area of code........... fname = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , "Load the BIP Data File from the MR&D Data Warehouse") If fname < False Then Workbooks.Open FileName:=fname Else Sheets(Current_Sheet).Select Range(Current_Cell).Select End End If Sheets(1).Select Cells.Select Selection.Copy Workbooks(1).Activate Sheets(1).Select Cells.Select ActiveSheet.Paste ........................ Suggestions? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Setting up and Configuration of Excel | |||
Open HTML file, but doesn't copy correctly | Excel Worksheet Functions | |||
Save copy of file to open as read only | Excel Discussion (Misc queries) | |||
Open and copy all workbook sheets in a folder to a master file | Excel Discussion (Misc queries) | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) |