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: 24
Default Weird result

I would like to know what is wrong with the following macro.
If Fast05Chts.XLS is closed it works but not if that file is open. Instead I
get a message that the file is open. This is strange when the 'exit sub'
should have prevented this.

Any suggestions would be appreciated.

Roger

Dim File_Name As Variant, book As Object

'Dim book As Variant
File_Name = "Fast05Chts.XLS"
For Each book In Workbooks
If book.Name = File_Name Then
Windows(File_Name).Activate
Exit Sub
End If
Next book

Workbooks.Open Filename:="D:\Fast05\" & File_Name, UpdateLinks:=True


 
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
Weird "If" result Brad Excel Discussion (Misc queries) 1 March 2nd 10 10:17 PM
2 level subtotal result weird HFLo Excel Discussion (Misc queries) 2 November 30th 09 06:29 PM
Advanced formula - Return result & Show Cell Reference of result Irv Excel Worksheet Functions 7 May 6th 06 03:36 AM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM
Array formula weird result Solerman Kaplon via OfficeKB.com Excel Discussion (Misc queries) 2 December 21st 04 08:39 PM


All times are GMT +1. The time now is 01:16 AM.

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"