Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Open a workbook and then size it to fit just within the application window

Public Sub OpenBook()     Workbooks.Open ActiveWorkbook.Path & "\MyWorkbook.xls"     FitWindow End Sub Private Sub FitWindow()     Dim winWidth As Integer     Dim winHeight As Integer     winWidth = Application.UsableWidth 'Get the usable width of app window     winHeight = Application.UsableHeight End Sub