PC Review


Reply
Thread Tools Rate Thread

Close macro file

 
 
MrRJ
Guest
Posts: n/a
 
      13th Feb 2009
Hi,

I have built a macro in which it has done it thing. Now, it is complete,
can I close the file that contains the macro too? Is that possible?

MrRJ
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      13th Feb 2009
try

application.quit

"MrRJ" wrote:

> Hi,
>
> I have built a macro in which it has done it thing. Now, it is complete,
> can I close the file that contains the macro too? Is that possible?
>
> MrRJ

 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      13th Feb 2009
ActiveWorkbook.Close
' closes the active workbook and lets the user decide if
' changes are to be saved or not

On Feb 13, 2:26*pm, MrRJ <M...@discussions.microsoft.com> wrote:
> Hi,
>
> I have built a macro in which it has done it thing. *Now, it is complete,
> can I close the file that contains the macro too? *Is that possible?
>
> MrRJ


 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      13th Feb 2009
Jim: the problem is the saveas closes the oringal workbook and only nleaves
the saveas file opened. if yo want to go back to the original file you have
to re-open the workbook.

"Jim" wrote:

> ActiveWorkbook.Close
> ' closes the active workbook and lets the user decide if
> ' changes are to be saved or not
>
> On Feb 13, 2:26 pm, MrRJ <M...@discussions.microsoft.com> wrote:
> > Hi,
> >
> > I have built a macro in which it has done it thing. Now, it is complete,
> > can I close the file that contains the macro too? Is that possible?
> >
> > MrRJ

>
>

 
Reply With Quote
 
MrRJ
Guest
Posts: n/a
 
      13th Feb 2009
Thanks guys. I didn't want to close the whole application, just in case the
user has other files open. So, I created a simple line with the specific
file name that the macro is being used.

I am all good.


"Joel" wrote:

> Jim: the problem is the saveas closes the oringal workbook and only nleaves
> the saveas file opened. if yo want to go back to the original file you have
> to re-open the workbook.
>
> "Jim" wrote:
>
> > ActiveWorkbook.Close
> > ' closes the active workbook and lets the user decide if
> > ' changes are to be saved or not
> >
> > On Feb 13, 2:26 pm, MrRJ <M...@discussions.microsoft.com> wrote:
> > > Hi,
> > >
> > > I have built a macro in which it has done it thing. Now, it is complete,
> > > can I close the file that contains the macro too? Is that possible?
> > >
> > > MrRJ

> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
close file macro Tizy Microsoft Excel Programming 2 23rd Jul 2005 12:34 AM
Close file and run macro from newly opened file =?Utf-8?B?UHJhZGlwIEphaW4=?= Microsoft Excel Programming 1 23rd Apr 2005 11:39 PM
use a macro to close a file =?Utf-8?B?d3RwY29tcGxhYg==?= Microsoft Excel Programming 4 23rd Nov 2004 06:45 PM
close file macro Will Fleenor Microsoft Excel Programming 3 21st Oct 2004 05:49 PM
Automate open file, update links, run macro, close and save file Geoff Microsoft Excel Programming 2 26th Aug 2003 10:13 PM


Features
 

Advertising
 

Newsgroups
 


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