+ Reply to Thread
Results 1 to 17 of 17

By Passing VBA Msg Boxes the ones that Display Alerts wont work on

  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    I have a problem in that I'm opening 18 raw data txt files in my Import Folder, I am deleting the top line as it has a double header then renaming the txt file to a standard name which I use to link the 18 files to access in a different folder.

    I already have the display alerts disabled but it pops up msg box to confirm if i want to save which you have to press yes, it then asks you again and this time you have to press no (I think this is where its actually asking if I want to keep it in this format)

    So if anyone has any ideas I would be greatful

    I have all the code working apart from when its saving and bring up the pop up boxes which means I have to click yes no 36 times a day

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    please post the code showing where you used displayalerts
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    can you post your code?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Please Login or Register  to view this content.
    Last edited by Cupelix; 12-14-2012 at 10:06 AM.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    please add code tags to your post

  6. #6
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Tags added

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    thank you :-)

    try replacing
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Didn't work, still popping up the "do you want to save the changes to file.txt"

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Remove "File Location" & from the saveas path

    Please Login or Register  to view this content.

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    I just tested your code (without the loop) in both 2003 and 2010 and it works as expected with no prompts. do you have anything else that may be interfering such as an add-in or document management software?

  11. #11
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    not as far as i'm aware, the only thing we possibly have is a document classification software which i disable before it runs so unless that is causing an issue

  12. #12
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Mike that would be rather pointless as it needs that information to save the file in a new location with its new name.

    I used the File Location to hide the real location/name of our network drives.

  13. #13
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Well I didnt see were you said you were hiding Filelocation.

  14. #14
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    you could try skipping excel and using the scripting.runtime
    Please Login or Register  to view this content.
    for instance

  15. #15
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    will I be able to delete the first line of the txt file as it has 2 header lines and i'm only interested in the 2nd one, as the first is just the name of the file or should I be looking at getting the data output to not include the first header. I will give this code a go and let you know.

    Also how do I get that to work on the 18 different files, as they are date stamped as part of the file name.
    Last edited by Cupelix; 12-14-2012 at 12:33 PM.

  16. #16
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    that code opens the input file, skips the first line then outputs the rest to new file

  17. #17
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: By Passing VBA Msg Boxes the ones that Display Alerts wont work on

    Thank you very much I have adjusted it slightly but wow works a treat, thanks again for the outside of the box solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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