Special cmdbar button activating Enable Macro dialog

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

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
 
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.)
 
Dave,

Thanks for the reply! Your input is Much appreciated!

Sorry - I left out that part.
Like I said - the code was "stolen" from the ng and does include the
delete on workbook close, and before building the cmdbar.

I did numerous Set .... = Nothing through out the code and am waiting
for my user to get back to me.

If this doesn't fix the problem than I'll repost with more pertinent
info and I'll try to be more complete in info about the existing
workbook.

steve

p.s.
may have sent this before, but am not sure...
 
Back
Top