Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable the "X" close button in an excel application
Hi keepITcool,
I have Inserted your code into my object module but the sentance, "Dim WithEvents xlApp As Application", keeps giving me an error. Could you possibly help ? Thanks Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable the "X" close button in an excel application
I dont know what you consider 'my object module' my code is meant to go in the code module of Thisworkbook object. NOT in a normal module. that was the whole point. open VBE double click ThisWorkbook in Project Explorer. a code pane opens (or is activated) titled: BookX.xls - ThisWorkbook[code] copy my code there. (and remove it anywhere else) now you should be able to use the dropdowns at the top of the codepane and select the General and the objects workbook and xlapp ... note if you select xlApp in the LEFT dropdown.. the available events are listed on the Right. From VBA help: WithEvents Optional. Keyword that specifies that varname is an object variable used to respond to events triggered by an ActiveX object. WithEvents is valid only in class modules. You can declare as many individual variables as you like using WithEvents, but you can't create arrays with WithEvents. You can't use New with WithEvents. Re 'WithEvents is valid only in class modules.': modules behind a userform, worksheet or thisworkbook are defacto classmodules. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Tempy wrote : Hi keepITcool, I have Inserted your code into my object module but the sentance, "Dim WithEvents xlApp As Application", keeps giving me an error. Could you possibly help ? Thanks Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable the "X" close button in an excel application
Hi KeepITcool,
Thanks very much, i found the problem and it working just great, thanks for all the help and understanding. I seem to have created quite a bit of dialog with this subject!! Thanks again for a great job to all. best regards, Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable the "X" close button in an excel application
Troublemaker :-)
"Tempy" wrote in message ... Hi KeepITcool, Thanks very much, i found the problem and it working just great, thanks for all the help and understanding. I seem to have created quite a bit of dialog with this subject!! Thanks again for a great job to all. best regards, Tempy *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable the "X" close button in an excel application | Excel Programming | |||
Disable the "X" close button in an excel application | Excel Programming | |||
Disable the "X" close button in an excel application | Excel Programming | |||
Disable Close "X" button on User Forms | Excel Programming | |||
SIMPLEST way to disable "close" button on form? | Excel Programming |