Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Opening properties box

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
graphics properties changes when opening Excel Zebcougar Excel Discussion (Misc queries) 1 October 19th 09 06:59 AM
using properties Mrs. Smith Excel Discussion (Misc queries) 1 June 4th 07 05:37 PM
Setting format properties when opening Worksheet Don Excel Worksheet Functions 1 December 12th 06 10:27 AM
REF errors when opening excel in xp. works fine when opening wor. br Excel Discussion (Misc queries) 6 September 13th 05 11:41 AM


All times are GMT +1. The time now is 09:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"