Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summary sheet including only open projects. | Excel Discussion (Misc queries) | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
Duplicate Projects in VBE project Window... Very annoying. | Excel Programming | |||
Pick projects from sheet and create new sheet per project | Excel Programming | |||
How to become a better programmer, post college. More projects or less projects. | Excel Programming |