LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting worksheets containing ActiveX controls

I am having trouble deleting worksheets containing ActiveX
controls whilst maintaining the values in publicly
declared variables.
EG.

Create two worksheets, each with two command buttons on.
On Sheet2, put in the following VBA code:

Code:
Option Explicit 
public bln as boolean 

Private Sub CommandButton1_Click 
    bln = True 
    Application.DisplayAlerts = False 
    Sheets("Sheet1").Delete 
    Application.DisplayAlerts = True 
End Sub 

Private Sub CommandButton2_Click 
    msgbox bln 
End Sub
Now exit design mode and try clicking button 1 followed by
button 2. It SHOULD display 'TRUE', but it actually
displays 'FALSE' as the publicly declared variable bln has
been cleared.

Anyone have any ideas?

Thanks,

alex
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab between ActiveX controls Tekhnikos Excel Discussion (Misc queries) 0 August 12th 08 03:42 PM
ActiveX controls Luke Excel Discussion (Misc queries) 1 October 26th 06 02:00 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
ActiveX Controls David Fixemer Excel Programming 4 February 16th 04 05:20 PM
Deleting ActiveX Controls Ron[_12_] Excel Programming 1 October 16th 03 03:42 PM


All times are GMT +1. The time now is 06:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"