Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steveb wrote:
Is there anyway of having the properties dialog box open up automatically when starting a blank spreadsheet? The code is easy: Application.Dialogs(xlDialogProperties).Show The question is how to make it run. You could put it in Workbook_Open in a workbook template BOOK.XLT in your XLSTART directory - but then you will get the macro virus warning when you create a new workbook. Also you would need to arrange for it only to run on first open If ThisWorkbook.Path = "" Then Application.Dialogs(xlDialogProperties).Show End If Better would be to make an application-level event handler in your PERSONAL.XLS detect a new workbook. In Personal.xls (or some other workbook in your XLSTART directory): - Insert / Class Module - name it clsApp (for example) - paste in this code: Public WithEvents oXL As Excel.Application Private Sub oXL_NewWorkbook(ByVal Wb As Excel.Workbook) If Wb.Path = "" Then Application.Dialogs(xlDialogProperties).Show End If End Sub - Insert / Module - paste in the following code: Dim clsXL As New clsApp Sub Auto_Open() Set clsXL.oXL = Application End Sub Sub Auto_Close() Set clsXL = Nothing End Sub - save the workbook - run Auto_Open - create a new workbook (to test it out). Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I stop blank workbook from opening when opening an existing | Excel Discussion (Misc queries) | |||
graphics properties changes when opening Excel | Excel Discussion (Misc queries) | |||
using properties | Excel Discussion (Misc queries) | |||
Setting format properties when opening Worksheet | Excel Worksheet Functions | |||
REF errors when opening excel in xp. works fine when opening wor. | Excel Discussion (Misc queries) |