Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default duplicate vb projects occur when reopening a sheet

Strange, I have written vb code which updates data when the file is opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb project
and none of the code executes. However when I close excel 2003 and open the
workbook then everything runs fine.

Any ideas,

Allan
--
AH
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default duplicate vb projects occur when reopening a sheet

Did you copy any worksheets in your code? Make sure when you copy a
worksheet you include either before of after otherwise a new workbook is
created.

sheets("sheet1").copy after:=sheets(sheets.count)

"Allan" wrote:

Strange, I have written vb code which updates data when the file is opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb project
and none of the code executes. However when I close excel 2003 and open the
workbook then everything runs fine.

Any ideas,

Allan
--
AH

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default duplicate vb projects occur when reopening a sheet

He is talking about duplicate entries for the project within the project
explorer.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Joel" wrote in message
...
Did you copy any worksheets in your code? Make sure when you copy a
worksheet you include either before of after otherwise a new workbook is
created.

sheets("sheet1").copy after:=sheets(sheets.count)

"Allan" wrote:

Strange, I have written vb code which updates data when the file is
opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb
project
and none of the code executes. However when I close excel 2003 and open
the
workbook then everything runs fine.

Any ideas,

Allan
--
AH



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default duplicate vb projects occur when reopening a sheet

bob: if Allan alunch a 2nd excel application from his macro is could be
invisible and would not terminate when the workbook is closed. I thinnk we
need to see Allan's code or a better description of what he is doing to give
him the proper answer.

"Bob Phillips" wrote:

He is talking about duplicate entries for the project within the project
explorer.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Joel" wrote in message
...
Did you copy any worksheets in your code? Make sure when you copy a
worksheet you include either before of after otherwise a new workbook is
created.

sheets("sheet1").copy after:=sheets(sheets.count)

"Allan" wrote:

Strange, I have written vb code which updates data when the file is
opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb
project
and none of the code executes. However when I close excel 2003 and open
the
workbook then everything runs fine.

Any ideas,

Allan
--
AH




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default duplicate vb projects occur when reopening a sheet

Thanks guys, but im not laucnhing a 2nd excel app.

But what I've done is eliminate a copy of a sheet to a backup sheet.
then I added
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub

This seemed to solve the problem.

But after an hour or so of testing all of a sudden when I close the
workbook a msg box appears asking me if i want to save the changes. i would
have thought the ActiveWorkbook.Save would take care of this.

I'm Stumped




--
AH


"Joel" wrote:

bob: if Allan alunch a 2nd excel application from his macro is could be
invisible and would not terminate when the workbook is closed. I thinnk we
need to see Allan's code or a better description of what he is doing to give
him the proper answer.

"Bob Phillips" wrote:

He is talking about duplicate entries for the project within the project
explorer.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Joel" wrote in message
...
Did you copy any worksheets in your code? Make sure when you copy a
worksheet you include either before of after otherwise a new workbook is
created.

sheets("sheet1").copy after:=sheets(sheets.count)

"Allan" wrote:

Strange, I have written vb code which updates data when the file is
opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb
project
and none of the code executes. However when I close excel 2003 and open
the
workbook then everything runs fine.

Any ideas,

Allan
--
AH






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default duplicate vb projects occur when reopening a sheet

If you are closing from a macro then you need to add savechanges to eliminate
the prompt.

Workbooks("BOOK1.XLS").Close SaveChanges:=true


"Allan" wrote:

Thanks guys, but im not laucnhing a 2nd excel app.

But what I've done is eliminate a copy of a sheet to a backup sheet.
then I added
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub

This seemed to solve the problem.

But after an hour or so of testing all of a sudden when I close the
workbook a msg box appears asking me if i want to save the changes. i would
have thought the ActiveWorkbook.Save would take care of this.

I'm Stumped




--
AH


"Joel" wrote:

bob: if Allan alunch a 2nd excel application from his macro is could be
invisible and would not terminate when the workbook is closed. I thinnk we
need to see Allan's code or a better description of what he is doing to give
him the proper answer.

"Bob Phillips" wrote:

He is talking about duplicate entries for the project within the project
explorer.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Joel" wrote in message
...
Did you copy any worksheets in your code? Make sure when you copy a
worksheet you include either before of after otherwise a new workbook is
created.

sheets("sheet1").copy after:=sheets(sheets.count)

"Allan" wrote:

Strange, I have written vb code which updates data when the file is
opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb
project
and none of the code executes. However when I close excel 2003 and open
the
workbook then everything runs fine.

Any ideas,

Allan
--
AH



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default duplicate vb projects occur when reopening a sheet

Try searching this group for "Phantom Projects". Not so much in the hope of
finding a solution but to give some comfort it doesn't only affect you!

Having said that, I think Jon Peltier had a theory that third party VSTO
type addns were implicated. That wasn't applicable to me and I posted some
code that sorted out mine, though I don't recall anyone reported it of being
any use to them.

Regards,
Peter T

"Allan" wrote in message
...
Strange, I have written vb code which updates data when the file is

opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb

project
and none of the code executes. However when I close excel 2003 and open

the
workbook then everything runs fine.

Any ideas,

Allan
--
AH



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default duplicate vb projects occur when reopening a sheet

It seems that i forgot to add the statement .
Application.EnableEvents = True after I set it to false.

I have two combo box's that read from a sheet but the first box sets the
second box and the second box can set the first box
I orginally set Application.EnableEvents = false so they wouldn' t undo
what the other did.

Whether this had anything to do with having the vb project name remain
after the workbook was closed and duplicated when the workbook was reopened
I don't know but so far it has has resolved this issue

Thanks all for the suggestions
--
AH


"Peter T" wrote:

Try searching this group for "Phantom Projects". Not so much in the hope of
finding a solution but to give some comfort it doesn't only affect you!

Having said that, I think Jon Peltier had a theory that third party VSTO
type addns were implicated. That wasn't applicable to me and I posted some
code that sorted out mine, though I don't recall anyone reported it of being
any use to them.

Regards,
Peter T

"Allan" wrote in message
...
Strange, I have written vb code which updates data when the file is

opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb

project
and none of the code executes. However when I close excel 2003 and open

the
workbook then everything runs fine.

Any ideas,

Allan
--
AH




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default duplicate vb projects occur when reopening a sheet

I had problems with MicroCharts COM addin generating phantom in my system.
Removing the addin cleared the problem.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Peter T" <peter_t@discussions wrote in message
...
Try searching this group for "Phantom Projects". Not so much in the hope
of
finding a solution but to give some comfort it doesn't only affect you!

Having said that, I think Jon Peltier had a theory that third party VSTO
type addns were implicated. That wasn't applicable to me and I posted some
code that sorted out mine, though I don't recall anyone reported it of
being
any use to them.

Regards,
Peter T

"Allan" wrote in message
...
Strange, I have written vb code which updates data when the file is

opened.
But when I close the workbook the vb project is still showing in the vb
window.
So when I reopen up the workbook I now have two instances of the vb

project
and none of the code executes. However when I close excel 2003 and open

the
workbook then everything runs fine.

Any ideas,

Allan
--
AH





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default duplicate vb projects occur when reopening a sheet

Joel,

He is talking about spurious duplicates. I know, I have had them, caused by
3rd party addins.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Joel" wrote in message
...
bob: if Allan alunch a 2nd excel application from his macro is could be
invisible and would not terminate when the workbook is closed. I thinnk
we
need to see Allan's code or a better description of what he is doing to
give
him the proper answer.

"Bob Phillips" wrote:

He is talking about duplicate entries for the project within the project
explorer.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Joel" wrote in message
...
Did you copy any worksheets in your code? Make sure when you copy a
worksheet you include either before of after otherwise a new workbook
is
created.

sheets("sheet1").copy after:=sheets(sheets.count)

"Allan" wrote:

Strange, I have written vb code which updates data when the file is
opened.
But when I close the workbook the vb project is still showing in the
vb
window.
So when I reopen up the workbook I now have two instances of the vb
project
and none of the code executes. However when I close excel 2003 and
open
the
workbook then everything runs fine.

Any ideas,

Allan
--
AH






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
Summary sheet including only open projects. KTB Excel Discussion (Misc queries) 1 March 25th 10 02:15 PM
Duplicate sheet, autonumber sheet, record data on another sheet des-sa[_2_] Excel Worksheet Functions 0 May 8th 08 06:56 PM
Duplicate Projects in VBE project Window... Very annoying. MikeZz Excel Programming 5 February 9th 07 08:21 PM
Pick projects from sheet and create new sheet per project GregR Excel Programming 4 February 6th 06 05:51 PM
How to become a better programmer, post college. More projects or less projects. Matt Somers Excel Programming 1 February 12th 04 01:54 PM


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