Declare a Workbook object variable and assign the ActiveWorkbook object to it, so that subsequent code can work with the object variable:
Sub workbook() Dim myWorkbook As Workbooks Set myWorkbook = ActiveWorkbook With myWorkbook 'actions here End With End Sub