Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default File Duplicated in VBE Explorer Pane

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default File Duplicated in VBE Explorer Pane

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default File Duplicated in VBE Explorer Pane

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default File Duplicated in VBE Explorer Pane

Mis-interpreted your original.

What you're saying is it looks like the file has two instances loaded?

I don't know what causes this effect.

Happens to me on occasion but no ideas.


Gord

On Sat, 6 Sep 2008 07:46:09 -0700, JMay
wrote:

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default File Duplicated in VBE Explorer Pane

Yeah - like you say, it looks like two instances are loaded.
Oh Well, Much obliged for taking the time to look and comment,
Jim


"Gord Dibben" wrote:

Mis-interpreted your original.

What you're saying is it looks like the file has two instances loaded?

I don't know what causes this effect.

Happens to me on occasion but no ideas.


Gord

On Sat, 6 Sep 2008 07:46:09 -0700, JMay
wrote:

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default File Duplicated in VBE Explorer Pane

Just to add to what Gord wrote...

If you're careful--don't work with those projects, then it shouldn't be a
problem. If you work with those ghost projects, you'll be wasting your time.

If it really bothers you, close excel and restart it. That's the only way I've
seen that removes the ghost projects.

Gord Dibben wrote:

Mis-interpreted your original.

What you're saying is it looks like the file has two instances loaded?

I don't know what causes this effect.

Happens to me on occasion but no ideas.

Gord

On Sat, 6 Sep 2008 07:46:09 -0700, JMay
wrote:

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub



--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default File Duplicated in VBE Explorer Pane

Thanks Dave for your input -- Ghosts (we are getting close to halloween
here!!)

"Dave Peterson" wrote:

Just to add to what Gord wrote...

If you're careful--don't work with those projects, then it shouldn't be a
problem. If you work with those ghost projects, you'll be wasting your time.

If it really bothers you, close excel and restart it. That's the only way I've
seen that removes the ghost projects.

Gord Dibben wrote:

Mis-interpreted your original.

What you're saying is it looks like the file has two instances loaded?

I don't know what causes this effect.

Happens to me on occasion but no ideas.

Gord

On Sat, 6 Sep 2008 07:46:09 -0700, JMay
wrote:

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub



--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default File Duplicated in VBE Explorer Pane

Who ya gonna call?

http://www.imdb.com/title/tt0087332/quotes

JMay wrote:

Thanks Dave for your input -- Ghosts (we are getting close to halloween
here!!)

"Dave Peterson" wrote:

Just to add to what Gord wrote...

If you're careful--don't work with those projects, then it shouldn't be a
problem. If you work with those ghost projects, you'll be wasting your time.

If it really bothers you, close excel and restart it. That's the only way I've
seen that removes the ghost projects.

Gord Dibben wrote:

Mis-interpreted your original.

What you're saying is it looks like the file has two instances loaded?

I don't know what causes this effect.

Happens to me on occasion but no ideas.

Gord

On Sat, 6 Sep 2008 07:46:09 -0700, JMay
wrote:

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub



--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default File Duplicated in VBE Explorer Pane

GHOSTBUSTER!!! - Bill Murray and the gang

"Dave Peterson" wrote:

Who ya gonna call?

http://www.imdb.com/title/tt0087332/quotes

JMay wrote:

Thanks Dave for your input -- Ghosts (we are getting close to halloween
here!!)

"Dave Peterson" wrote:

Just to add to what Gord wrote...

If you're careful--don't work with those projects, then it shouldn't be a
problem. If you work with those ghost projects, you'll be wasting your time.

If it really bothers you, close excel and restart it. That's the only way I've
seen that removes the ghost projects.

Gord Dibben wrote:

Mis-interpreted your original.

What you're saying is it looks like the file has two instances loaded?

I don't know what causes this effect.

Happens to me on occasion but no ideas.

Gord

On Sat, 6 Sep 2008 07:46:09 -0700, JMay
wrote:

Thanks Gord, but note that these 3 ARE in the THISWORKBOOK Module
"Private Sub Workbook"

I created Module1 to house the one-liner:
Public mFlag '<<to make its value visible/In Scope...

"Gord Dibben" wrote:

Place the code into Thisworkbook module.

Those type of events don't fire from a general module.


Gord Dibben MS Excel MVP

On Sat, 6 Sep 2008 07:01:01 -0700, JMay
wrote:

Just playing around to be warned if a file has been altered in any way (dirty).
Somehow if before closing I switch to the VBE envirnoment - I see 2
representions of the file complete with sheet1, sheet2, sheet3, thisworkbook
and module1

In module1 I only have

Public mFlag

I'm probably violating some rule causing this - can someone comment on this?
TIA

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If mFlag = True Then
MsgBox "You have altered your file"
Else
MsgBox "You have NOT altered your file"
End If
End Sub


Private Sub Workbook_Open()
Dim mFlag As Boolean
mFlag = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
mFlag = True
End Sub



--

Dave Peterson


--

Dave Peterson

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
Creates new file when opening in windows explorer fund_dan Excel Discussion (Misc queries) 4 December 27th 07 08:23 PM
Open Excel File in Internet Explorer ken1975 Excel Discussion (Misc queries) 0 November 20th 07 09:41 PM
pane freezes when file is opened andy b Excel Discussion (Misc queries) 3 July 4th 05 02:28 PM
Double Click .xls file in Explorer opens Excel but no file Kaypee Setting up and Configuration of Excel 3 March 3rd 05 03:45 PM
Cant open XLS file via explorer James Deland Excel Discussion (Misc queries) 1 February 3rd 05 12:47 AM


All times are GMT +1. The time now is 04:01 AM.

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

About Us

"It's about Microsoft Excel"