13. april 2008 - 13:27Der er
3 kommentarer og 1 løsning
Afvikling af VB code ved åbning og lukning af excel-fil
Jeg vil gerne have at der bliver afviklet en VB kode når jeg åbner en excel-fil og når jeg lukker den igen.
Denne kode vil jeg gerne have afviklet ved start:
Sub MyFullScreenOn()
Application.ScreenUpdating = False For Each cB In CommandBars If cB.Type = msoBarTypeNormal Then cB.Visible = False End If Next cB ActiveWindow.DisplayWorkbookTabs = False Application.DisplayFullScreen = True Application.CommandBars("Full Screen").Visible = False Application.ScreenUpdating = True
End Sub
Og denne kode vil jeg gerne have afviklet ved lukning af excel-filen.
Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ScreenUpdating = False For Each cB In CommandBars If cB.Type = msoBarTypeNormal Then cB.Visible = False End If Next cB ActiveWindow.DisplayWorkbookTabs = False Application.DisplayFullScreen = True Application.CommandBars("Full Screen").Visible = False Application.ScreenUpdating = True End Sub
Private Sub Workbook_Open() Application.ScreenUpdating = False Application.DisplayFullScreen = False ActiveWindow.DisplayWorkbookTabs = True Application.CommandBars("Standard").Visible = True Application.CommandBars("Formatting").Visible = True Application.ScreenUpdating = True End Sub
Private Sub Workbook_Open() Application.ScreenUpdating = False For Each cB In CommandBars If cB.Type = msoBarTypeNormal Then cB.Visible = False End If Next cB ActiveWindow.DisplayWorkbookTabs = False Application.DisplayFullScreen = True Application.CommandBars("Full Screen").Visible = False Application.ScreenUpdating = True End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ScreenUpdating = False Application.DisplayFullScreen = False ActiveWindow.DisplayWorkbookTabs = True Application.CommandBars("Standard").Visible = True Application.CommandBars("Formatting").Visible = True Application.ScreenUpdating = True End Sub
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.