View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DaveM[_2_] DaveM[_2_] is offline
external usenet poster
 
Posts: 77
Default Stop a workbook from Opening

Hi all

When I run this macro it opens the workbook I've just saved, how can I stop
it from opening after the macro has ran.

Sub SaveOneSheet()
Dim Sht As Worksheet
Const PATH As String = "C:\test\"
Set Sht = ActiveWorkbook.Sheets("Test1")
Sht.Select
Sht.Copy
ActiveWorkbook.SaveAs Filename:= _
PATH & Sht.Range("G1") & ".xls", FileFormat:=xlNormal
End Sub

Thanks in advance

Dave