View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Leanne M (Aussie) Leanne M (Aussie) is offline
external usenet poster
 
Posts: 53
Default Open or switch to a file

Hi,

I have code to open a file in a command button which works fine.

What I would like to do is allow this button to also switch to this file if
it is already open.

I do not know how to write this so detailed help would be apprecitated.

This is the code I have for opening the file.

Private Sub CommandButton3_Click()
ChDir "C:\My Documents\Pest Control Management System"
Workbooks.Open Filename:= _
"C:\My Documents\Pest Control Management System\Pest Control
Reporting Tool.xls"
End Sub

--
Leanne M (Aussie)
(Changed Display name from Leanne)
United Kingdom
(Don''t ask me what an Aussie is doing living in the UK!)