Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Further ActiveX Control (TextBox) questions

A single sheet workbook opens. If ContractMaster = True
(in the Workbook_Open Event) then an ActiveX Control
(a Textbox) is enabled, and user can make their changes.

When user comes to save, I am using the Workbook_BeforeSave
Event to test for ContractMaster as follows:

If ContractMaster = True Then
Dim ws As Worksheet
Application.ScreenUpdating = False
With Workbooks
.Add
Workbooks(wkbkname).Sheets("Master Fax").Copy _
Befo=ActiveWorkbook.Sheets(1)
Application.DisplayAlerts = False
For Each ws In ActiveWorkbook.Worksheets
With ws
If .Name < "Master Fax" Then
.Delete
End If
End With
Next
With ActiveWorkbook.Sheets("Master Fax")
.Range("C19").Select
.Protect
.EnableSelection = xlUnlockedCells
End With
'To hide the textbox,try:
ActiveSheet.OLEObjects("Textbox1").Visible = False
'To prevent editing, try:
ActiveSheet.OLEObjects("Textbox1").Enabled = False
End With
End If

I'm creating a new workbook and copying the data sheet to
that, because I cannot get Chip's DeleteAllVBA code to
run correctly (he does say it is unreliable when run from a
module that, itself, is to be deleted

It's not working as intended. Ideally, if ContractMaster =
True, then
a) strip all code from the workbook
b) remove the ActiveX Control
c) save the changed file (I have code that lets the user
choose the filename and folder)
d) leave the changed file visible as the activeworkbook

Can this be achieved, please?

Regards.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.714 / Virus Database: 470 - Release Date: 02/07/2004


Reply
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
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Excel ActiveX TextBox Question dhstein Excel Discussion (Misc queries) 4 January 29th 09 02:12 PM
ActiveX Control (TextBox) question Stuart[_5_] Excel Programming 2 July 4th 04 12:37 PM
Further ActiveX questions david fixemer Excel Programming 0 February 16th 04 09:49 PM
Dynamic TextBox ActiveX events Tom Ogilvy Excel Programming 0 September 29th 03 08:56 PM


All times are GMT +1. The time now is 07:18 AM.

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

About Us

"It's about Microsoft Excel"