View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Allan Allan is offline
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