View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
AmyTaylor[_22_] AmyTaylor[_22_] is offline
external usenet poster
 
Posts: 1
Default Problem opening a file


Hi everyone, i have a piece of basic code that calls a workbook

Workbooks.Open Filename:="\\server1\files\amy\Activity.xls"

This works perfectly, until I navigate away from Activity.xls back t
the main sheet workbook called Main.xls.
What happens is that when I am back in Main.xls and run the above cod
to go back to Activity.xls it create a run-time error 1004 as the fil
is already open.

Does anyone know if I can add some code to see if the file is open, an
it it is activate it, otherwise open the file afresh?

Thanks for your help.

Amy x

--
AmyTaylo
-----------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...fo&userid=2097
View this thread: http://www.excelforum.com/showthread.php?threadid=39605