View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Special cmdbar button activating Enable Macro dialog

Do you delete the toolbar on the way out (like you do when you open your
workbook)?

If no, then the toolbar stays alive even though the workbook is closed. You
click on the icon and excel knows where to find that macro--even if xl has to
open it!

Something like this in the thisworkbook module:

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("yourcbar").Delete
On Error GoTo 0
End Sub

(just like your delete when you start.)

steve wrote:

Don't know if this has anything to do with this, BUT checked my code and
found a large number of Set statements without any Set ..... = Nothing

Could these have created the "ghost" connections?

steve

"steve" wrote in message
...
I created a workbook using Excel97 SR2 on Win 2000.
The workbook works just fine on my computer.
My user has Excel2k on WinXP.

When he clicks on a cmdbar button (to activate a form) he gets the Enable
Macro dialog. He has also gotton the message about the workbook being

open
in another session and is locked for editing.

The cmdbar is created using the Workbook Open event. Am using code from
this ng that first deletes than creates the cmdbar.

Saw something in the ng during the past week (can't find it now) about
somehow creating a "ghost" session Excel and am thinking that this might

be
happening.

Does anyone have any clues about this? I'll be glad to post any code (if
asked). My code is fairly standard (?)
Workbook_Open to create cmdbar
Code to clear worksheet
Code to display multipage form
Code to check finished worksheet for missing input.

Thanks in advance for all help...

steve




--

Dave Peterson