Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Closing Excel from VBA

Hello,

Have a macro that emails out certaing information and
would like to closed or Exit Excel once code is executed.
Right now I have a Mssage box that let's the user know it
finished emailing the information but it advises the user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Closing Excel from VBA

Hi
normally
application.quit
should work. what is the code you have tried (have you eventually tried
to close the workbook prior to this statement?)

--
Regards
Frank Kabel
Frankfurt, Germany

"Jimmy" schrieb im Newsbeitrag
...
Hello,

Have a macro that emails out certaing information and
would like to closed or Exit Excel once code is executed.
Right now I have a Mssage box that let's the user know it
finished emailing the information but it advises the user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Closing Excel from VBA

Do you close your workbook before you call quit?

.. . .
thisworkbook.Close
Application.Quit
End Sub

if so, the code stops executing when the workbook is closed, so it never
gets the quit. If you remove the close command, then application.quit will
be executed and this will take care of closing your workbook.

--
Regards,
Tom Ogilvy

"Jimmy" wrote in message
...
Hello,

Have a macro that emails out certaing information and
would like to closed or Exit Excel once code is executed.
Right now I have a Mssage box that let's the user know it
finished emailing the information but it advises the user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy



  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Closing Excel from VBA

Tried and it did not work.... Now I close the form,
maximize the workbook, then used
thisworkbook.Close
Application.Quit

Still not closing.. Could it be due to the Form??

Thanks in advance!
Jimmy

-----Original Message-----
Do you close your workbook before you call quit?

.. . .
thisworkbook.Close
Application.Quit
End Sub

if so, the code stops executing when the workbook is

closed, so it never
gets the quit. If you remove the close command, then

application.quit will
be executed and this will take care of closing your

workbook.

--
Regards,
Tom Ogilvy

"Jimmy" wrote in

message
...
Hello,

Have a macro that emails out certaing information and
would like to closed or Exit Excel once code is

executed.
Right now I have a Mssage box that let's the user know

it
finished emailing the information but it advises the

user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Closing Excel from VBA

I thought I advised to remove the Thisworkbook.close from the code.


I can't say if the form is interfering. Does the workbook close? If so,
then I would say the form isn't the reason - the reason is because you close
the workbook and code execution stops before reaching the quit command.

--
Regards,
Tom Ogilvy


wrote in message
...
Tried and it did not work.... Now I close the form,
maximize the workbook, then used
thisworkbook.Close
Application.Quit

Still not closing.. Could it be due to the Form??

Thanks in advance!
Jimmy

-----Original Message-----
Do you close your workbook before you call quit?

.. . .
thisworkbook.Close
Application.Quit
End Sub

if so, the code stops executing when the workbook is

closed, so it never
gets the quit. If you remove the close command, then

application.quit will
be executed and this will take care of closing your

workbook.

--
Regards,
Tom Ogilvy

"Jimmy" wrote in

message
...
Hello,

Have a macro that emails out certaing information and
would like to closed or Exit Excel once code is

executed.
Right now I have a Mssage box that let's the user know

it
finished emailing the information but it advises the

user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Closing Excel from VBA

Was using this code before I modified it to
thisworkbook.Close.

frmTestimonials.Hide
Application.ActiveWorkbook.Close False), "Testimonials.xls"
Application.ActiveWindow.Close (False), "Testimonials.xls"
Application.Quit


Any other suggestions??


Thanks!
Jimmy
-----Original Message-----
I thought I advised to remove the Thisworkbook.close from

the code.


I can't say if the form is interfering. Does the

workbook close? If so,
then I would say the form isn't the reason - the reason

is because you close
the workbook and code execution stops before reaching the

quit command.

--
Regards,
Tom Ogilvy


wrote in message
...
Tried and it did not work.... Now I close the form,
maximize the workbook, then used
thisworkbook.Close
Application.Quit

Still not closing.. Could it be due to the Form??

Thanks in advance!
Jimmy

-----Original Message-----
Do you close your workbook before you call quit?

.. . .
thisworkbook.Close
Application.Quit
End Sub

if so, the code stops executing when the workbook is

closed, so it never
gets the quit. If you remove the close command, then

application.quit will
be executed and this will take care of closing your

workbook.

--
Regards,
Tom Ogilvy

"Jimmy" wrote in

message
...
Hello,

Have a macro that emails out certaing information and
would like to closed or Exit Excel once code is

executed.
Right now I have a Mssage box that let's the user

know
it
finished emailing the information but it advises the

user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy


.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Closing Excel from VBA

Thanks!

That worked.. removed the thisworkbook.Close before the
App.Quit

Thanks Tom!
-----Original Message-----
Was using this code before I modified it to
thisworkbook.Close.

frmTestimonials.Hide
Application.ActiveWorkbook.Close

False), "Testimonials.xls"
Application.ActiveWindow.Close (False), "Testimonials.xls"
Application.Quit


Any other suggestions??


Thanks!
Jimmy
-----Original Message-----
I thought I advised to remove the Thisworkbook.close

from
the code.


I can't say if the form is interfering. Does the

workbook close? If so,
then I would say the form isn't the reason - the reason

is because you close
the workbook and code execution stops before reaching

the
quit command.

--
Regards,
Tom Ogilvy


wrote in message
...
Tried and it did not work.... Now I close the form,
maximize the workbook, then used
thisworkbook.Close
Application.Quit

Still not closing.. Could it be due to the Form??

Thanks in advance!
Jimmy

-----Original Message-----
Do you close your workbook before you call quit?

.. . .
thisworkbook.Close
Application.Quit
End Sub

if so, the code stops executing when the workbook is
closed, so it never
gets the quit. If you remove the close command, then
application.quit will
be executed and this will take care of closing your
workbook.

--
Regards,
Tom Ogilvy

"Jimmy" wrote in
message
...
Hello,

Have a macro that emails out certaing information

and
would like to closed or Exit Excel once code is
executed.
Right now I have a Mssage box that let's the user

know
it
finished emailing the information but it advises the
user
to please close excel.

Only one excel spreasheet opened and tried the
Application.Quit but that does not closes Excel.

Any ideas?

Thanks in advance!
Jimmy


.



.

.

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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
Closing excel Noah Excel Worksheet Functions 1 October 23rd 07 04:01 AM
Closing Excel with Red X lroboat Excel Discussion (Misc queries) 3 September 10th 07 02:29 PM
Closing VB triggers closing Excel Minilek Excel Programming 2 August 6th 04 05:17 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM


All times are GMT +1. The time now is 06:10 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"