Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
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
Disable the "X" close button in an excel application Patrick Molloy[_2_] Excel Programming 3 April 19th 05 08:28 AM
Disable the "X" close button in an excel application keepITcool Excel Programming 1 April 18th 05 07:16 PM
Disable the "X" close button in an excel application keepITcool Excel Programming 1 April 18th 05 11:28 AM
Disable Close "X" button on User Forms Celtic_Avenger[_50_] Excel Programming 0 October 11th 04 06:25 PM
SIMPLEST way to disable "close" button on form? codytheretriever Excel Programming 4 August 7th 03 09:00 PM


All times are GMT +1. The time now is 03:33 PM.

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"