ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   duplicate vb projects occur when reopening a sheet (https://www.excelbanter.com/excel-programming/411113-duplicate-vbulletin-projects-occur-when-reopening-sheet.html)

Allan

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

joel

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


Bob Phillips

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




joel

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





Allan

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





joel

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




Peter T

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




Allan

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





Bob Phillips

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






Bob Phillips

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








All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com