+ Reply to Thread
Results 1 to 12 of 12

Auto_Open Macro showing unwanted prompt

  1. #1
    Registered User
    Join Date
    04-30-2015
    Location
    Birmingham,England
    MS-Off Ver
    2016
    Posts
    11

    Auto_Open Macro showing unwanted prompt

    Hi all,
    I have an auto_open macro which saves file as a csv, then closes the application. The file is opened using Task Scheduler every night. Until recently this worked fine, but now when it runs it shows save changes prompt and fails to close Excel. I've not changed the macro so at a loss to know why this no longer works or how to fix. many thanks.
    Prompt.jpg
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Auto_Open Macro showing unwanted prompt

    Try use below line instead of ThisWorkbook.Save
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-30-2015
    Location
    Birmingham,England
    MS-Off Ver
    2016
    Posts
    11

    Re: Auto_Open Macro showing unwanted prompt

    This gets rid of the prompt, but leaves Excel open. This is better, but still not sure why I can't close excel and avoid the prompt. Thanks.

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Auto_Open Macro showing unwanted prompt

    Good morning dp39darren

    You are not telling Excel to close, you are forcing only the workbook to close - which it does.

    Use this command to completely close Excel.
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Auto_Open Macro showing unwanted prompt

    Try this
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-30-2015
    Location
    Birmingham,England
    MS-Off Ver
    2016
    Posts
    11

    Re: Auto_Open Macro showing unwanted prompt

    I still get the prompt. thanks.

  7. #7
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Auto_Open Macro showing unwanted prompt

    How about this:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-30-2015
    Location
    Birmingham,England
    MS-Off Ver
    2016
    Posts
    11

    Re: Auto_Open Macro showing unwanted prompt

    I've tried solutions with Debug & Step Into and it works fine, but not when running, so maybe something else?

  9. #9
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Auto_Open Macro showing unwanted prompt

    Hi dp39darren

    Can you delete all the data (we don't need to see any of that) and post the workbook?



    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  10. #10
    Registered User
    Join Date
    04-30-2015
    Location
    Birmingham,England
    MS-Off Ver
    2016
    Posts
    11

    Re: Auto_Open Macro showing unwanted prompt

    I think I have attached a file.
    This likely won't work as there is a Query which connects to a file on local network.
    Desired result is:
    Open Workbook > Refresh Query > Save sheet as .csv > Save Excel > Close Excel
    This happens from a scheduled task, so no manual intervention. As per original post, this worked until recently. thanks for your help.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Auto_Open Macro showing unwanted prompt

    Try again
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-30-2015
    Location
    Birmingham,England
    MS-Off Ver
    2016
    Posts
    11

    Re: Auto_Open Macro showing unwanted prompt

    That works. Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Textbox showing random unwanted entry number
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2017, 04:04 PM
  2. [SOLVED] Unwanted prompt when running auto_open macro
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-12-2012, 01:40 AM
  3. Unwanted buttons showing up in new sheet created with a Macro and Template sheet
    By fsurf02 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-15-2011, 06:20 PM
  4. Auto_Open Message Box, but option to disable Auto_Open
    By stir-crazy in forum Excel General
    Replies: 2
    Last Post: 12-06-2007, 08:31 PM
  5. [SOLVED] Unwanted change in width of columns when showing formula.
    By Erik Cardell in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-11-2006, 04:50 PM
  6. [SOLVED] Auto_Open/Workbook_Open subroutines showing SCREENUPDATING
    By WhytheQ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2005, 11:05 AM
  7. [SOLVED] graphs showing unwanted zero values
    By Zadig Galbaras in forum Excel General
    Replies: 2
    Last Post: 06-01-2005, 06:05 PM

Tags for this Thread

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