Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Return to Original File

Hi Frank,

The code works great:) Thanks a million!!

Stephen



Frank Kabel wrote:
*Hi
try
Dim wbk As Workbook
Dim old_book as workbook
set old_book=activeworkbook
On Error Resume Next
Set wbk = Workbooks("DATA.xls")
On Error GoTo 0
If wbk Is Nothing Then
Workbooks.Open Filename:= _
"C:\DATA.xls"
old_book.activate
Exit Sub
End If


-----Original Message-----
Hi peoples

I need to make an adjustment to my code. If it opens the

file DATA.xls
it needs to return to the original file (that was already

open). The
original file is different every month.

Dim wbk As Workbook
On Error Resume Next
Set wbk = Workbooks("DATA.xls")
On Error GoTo 0
If wbk Is Nothing Then
Workbooks.Open Filename:= _
"C:\DATA.xls"
Exit Sub
End If


Regards

Stephen


---
Message posted from http://www.ExcelForum.com/

.
*



---
Message posted from http://www.ExcelForum.com/

Reply
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
Macro to return to original cell Tonso Excel Discussion (Misc queries) 1 April 1st 10 02:48 AM
Hyperlink to web does not return to original Excel worksheet g. spence Excel Discussion (Misc queries) 1 November 23rd 07 05:04 PM
HOW DO I RETURN TO A RECOVERED FILE AFTER CHOOSING ORIGINAL lawilder Excel Discussion (Misc queries) 2 December 21st 05 10:38 PM
Auto save replaced my original file and now I need the original? Hols Excel Discussion (Misc queries) 1 August 15th 05 10:34 PM
Why will solver only return the original adjustable cell values? Del Excel Worksheet Functions 0 March 3rd 05 12:25 AM


All times are GMT +1. The time now is 08:58 PM.

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

About Us

"It's about Microsoft Excel"