Open then Close

M

Markus

I want to open another existing workbook ("H:\control.xls")
and then close my current workbook ("listing.xls")with one
command button. Any suggestions?
Thanks
 
T

Tom Ogilvy

Private Sub CommandButton1_Click()
workbooks.open "H:\control.xls"
Workbooks("Listing.xls").close Savechanges:=False
End Sub
 
S

SidBord

Sure. I do that all the time, but you have to write a
Visual Basic macro to do it.

Sub OpenClose()
Workbooks.Open FileName:="C:\)path).xls\"
Workbooks("thisworkbookname").Close SaveChanges:=True
End Sub

Having written that macro, now you can assign the macro
name to the button.
 
Top