LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
Open HTML file, but doesn't copy correctly Kmason5727 Excel Worksheet Functions 0 October 24th 08 04:47 AM
Save copy of file to open as read only Ray Clark[_2_] Excel Discussion (Misc queries) 2 June 20th 08 12:19 AM
Open and copy all workbook sheets in a folder to a master file [email protected] Excel Discussion (Misc queries) 0 November 2nd 06 04:29 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"