Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Test for first time a workbook is opened

I need a way to tell when a workbook is opened if it is the first time it is
being opened by a user.

Does anyone have any ideas?

Tia,
Ken


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Test for first time a workbook is opened

Ken,

If this is not a shared file then, in a spare cell (say Z99) put "First"

In a module put

Private Sub Auto_Open()
If Range("Z99").Value ="First" Then
Range("Z99").Value =""
code here to do what you want when the file is first opened.
Else
code here to do what you want when the file is opened subsequently
End If

End Sub

If the file is shared you'll have to use a separate cell for each user and
determine who has opened the file.

Look in VBA help for UserName to give you an idea of where to start.

Henry



"Ken Loomis" wrote in message
...
I need a way to tell when a workbook is opened if it is the first time it
is being opened by a user.

Does anyone have any ideas?

Tia,
Ken



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Test for first time a workbook is opened

Thanks, Henry,

It's not a shared workbook. Each user has their own copy, so this will work
great.

Ken


"Henry" wrote in message
...
Ken,

If this is not a shared file then, in a spare cell (say Z99) put "First"

In a module put

Private Sub Auto_Open()
If Range("Z99").Value ="First" Then
Range("Z99").Value =""
code here to do what you want when the file is first opened.
Else
code here to do what you want when the file is opened subsequently
End If

End Sub

If the file is shared you'll have to use a separate cell for each user and
determine who has opened the file.

Look in VBA help for UserName to give you an idea of where to start.

Henry



"Ken Loomis" wrote in message
...
I need a way to tell when a workbook is opened if it is the first time it
is being opened by a user.

Does anyone have any ideas?

Tia,
Ken





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Test for first time a workbook is opened

Ken,

What I do is create a sheet named "System" to hold all the variables for the
program.
Things like "First", Named ranges that hold Drop Down Box entries, Lookup
tables, in fact anything that is not 'data'.
I hide this sheet, so anyone having a casual look around in my workbook will
not be tempted to change anything important.

Henry


"Ken Loomis" wrote in message
...
Thanks, Henry,

It's not a shared workbook. Each user has their own copy, so this will
work great.

Ken


"Henry" wrote in message
...
Ken,

If this is not a shared file then, in a spare cell (say Z99) put "First"

In a module put

Private Sub Auto_Open()
If Range("Z99").Value ="First" Then
Range("Z99").Value =""
code here to do what you want when the file is first opened.
Else
code here to do what you want when the file is opened subsequently
End If

End Sub

If the file is shared you'll have to use a separate cell for each user
and
determine who has opened the file.

Look in VBA help for UserName to give you an idea of where to start.

Henry



"Ken Loomis" wrote in message
...
I need a way to tell when a workbook is opened if it is the first time it
is being opened by a user.

Does anyone have any ideas?

Tia,
Ken







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
Opening a workbook if not opened, going to it if already opened neotokyo[_2_] Excel Programming 1 September 24th 04 07:17 PM
Opening a workbook if not opened, going to it if already opened neotokyo Excel Programming 1 September 24th 04 06:33 PM
How to see if the opened workbook is opened by another user ? balexis Excel Programming 1 August 18th 04 04:11 PM
filling a combobox (without being prompted to save the workbook EVERY time its opened neowok[_34_] Excel Programming 2 March 1st 04 03:39 PM
How? Force Sheet1 to display each time the workbook is opened. lothario[_26_] Excel Programming 2 October 17th 03 06:40 AM


All times are GMT +1. The time now is 02:09 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"