+ Reply to Thread
Results 1 to 6 of 6

Macro to make excel close

  1. #1
    Registered User
    Join Date
    10-20-2005
    Posts
    11

    Macro to make excel close

    I'm making a program in excel, and have been trying to create a macro that makes excel close, without the "do you want to save" pop-up coming up, alas i have failed, does anyone have any ideas?i've tried activewindow.close...

  2. #2
    Zack Barresse
    Guest

    Re: Macro to make excel close

    Excel close? Or just the open file?

    ... will close the active workbook ..

    sub closebooknow()
    if activeworkbook is nothing then exit sub
    activeworkbook.close false
    end sub

    ... will close excel ..

    sub closeappnow()
    application.displayalerts = false
    application.quit
    end sub

    HTH

    --
    Regards,
    Zack Barresse, aka firefytr, (GT = TFS FF Zack)



    "grandfilth" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I'm making a program in excel, and have been trying to create a macro
    > that makes excel close, without the "do you want to save" pop-up coming
    > up, alas i have failed, does anyone have any ideas?i've tried
    > activewindow.close...
    >
    >
    > --
    > grandfilth
    > ------------------------------------------------------------------------
    > grandfilth's Profile:
    > http://www.excelforum.com/member.php...o&userid=28240
    > View this thread: http://www.excelforum.com/showthread...hreadid=477928
    >




  3. #3
    Jim Thomlinson
    Guest

    RE: Macro to make excel close

    You can use
    Activeworkbook.Saved = True
    to tell excel that the current file is already saved and no further action
    is required.

    Application.quit
    will close down Excel
    --
    HTH...

    Jim Thomlinson


    "grandfilth" wrote:

    >
    > I'm making a program in excel, and have been trying to create a macro
    > that makes excel close, without the "do you want to save" pop-up coming
    > up, alas i have failed, does anyone have any ideas?i've tried
    > activewindow.close...
    >
    >
    > --
    > grandfilth
    > ------------------------------------------------------------------------
    > grandfilth's Profile: http://www.excelforum.com/member.php...o&userid=28240
    > View this thread: http://www.excelforum.com/showthread...hreadid=477928
    >
    >


  4. #4
    Ron de Bruin
    Guest

    Re: Macro to make excel close

    Hi grandfilth

    You can have more then one workbook open in Excel.
    What you do then ?

    Try this

    ActiveWorkbook.Close False ' or true if you want to save
    Application.Quit




    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "grandfilth" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I'm making a program in excel, and have been trying to create a macro
    > that makes excel close, without the "do you want to save" pop-up coming
    > up, alas i have failed, does anyone have any ideas?i've tried
    > activewindow.close...
    >
    >
    > --
    > grandfilth
    > ------------------------------------------------------------------------
    > grandfilth's Profile: http://www.excelforum.com/member.php...o&userid=28240
    > View this thread: http://www.excelforum.com/showthread...hreadid=477928
    >




  5. #5
    Tom Ogilvy
    Guest

    Re: Macro to make excel close

    Application.DisplayAlerts = False
    Application.Quit

    --
    Regards,
    Tom Ogilvy

    "grandfilth" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I'm making a program in excel, and have been trying to create a macro
    > that makes excel close, without the "do you want to save" pop-up coming
    > up, alas i have failed, does anyone have any ideas?i've tried
    > activewindow.close...
    >
    >
    > --
    > grandfilth
    > ------------------------------------------------------------------------
    > grandfilth's Profile:

    http://www.excelforum.com/member.php...o&userid=28240
    > View this thread: http://www.excelforum.com/showthread...hreadid=477928
    >




  6. #6
    FSt1
    Guest

    RE: Macro to make excel close

    hi,
    ActiveWindow.save
    ActiveWindow.close

    this will prevent the save as box from popping up.

    FSt1

    "grandfilth" wrote:

    >
    > I'm making a program in excel, and have been trying to create a macro
    > that makes excel close, without the "do you want to save" pop-up coming
    > up, alas i have failed, does anyone have any ideas?i've tried
    > activewindow.close...
    >
    >
    > --
    > grandfilth
    > ------------------------------------------------------------------------
    > grandfilth's Profile: http://www.excelforum.com/member.php...o&userid=28240
    > View this thread: http://www.excelforum.com/showthread...hreadid=477928
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1