ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Special cmdbar button activating Enable Macro dialog (https://www.excelbanter.com/excel-programming/272570-special-cmdbar-button-activating-enable-macro-dialog.html)

steve

Special cmdbar button activating Enable Macro dialog
 
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[_3_]

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


steve bell

Special cmdbar button activating Enable Macro dialog
 
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...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 08:52 PM.

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