Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to have an operation used the first time that a workbook is
opened, but not ever again after that. I know how to designate code that runs when a workbook opens, but only once. I supposed I can 'brute force' it by writing code that erases a button once it's clicked, but I'm hoping there is something like a 'workbook-open' function. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Auto_New()
"pdberger" wrote in message ... I would like to have an operation used the first time that a workbook is opened, but not ever again after that. I know how to designate code that runs when a workbook opens, but only once. I supposed I can 'brute force' it by writing code that erases a button once it's clicked, but I'm hoping there is something like a 'workbook-open' function. Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_Open()
On Error Resume Next If Not Evaluate(ThisWorkbook.Names("___FirstTime").Refers To) Then MsgBox "This is the first time" ThisWorkbook.Names.Add Name:="___FirstTime", RefersTo:="=TRUE" ThisWorkbook.Names("___FirstTime").Visible = False ThisWorkbook.Save End If End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH RP (remove nothere from the email address if mailing direct) "pdberger" wrote in message ... I would like to have an operation used the first time that a workbook is opened, but not ever again after that. I know how to designate code that runs when a workbook opens, but only once. I supposed I can 'brute force' it by writing code that erases a button once it's clicked, but I'm hoping there is something like a 'workbook-open' function. Thanks in advance. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you meant: Auto_open()
Jezebel wrote: Auto_New() "pdberger" wrote in message ... I would like to have an operation used the first time that a workbook is opened, but not ever again after that. I know how to designate code that runs when a workbook opens, but only once. I supposed I can 'brute force' it by writing code that erases a button once it's clicked, but I'm hoping there is something like a 'workbook-open' function. Thanks in advance. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Time with VBA code | Excel Discussion (Misc queries) | |||
Time code | Excel Discussion (Misc queries) | |||
On Time code | Excel Programming | |||
Time Code | Excel Programming | |||
Same VBA code, different run time | Excel Programming |