+ Reply to Thread
Results 1 to 8 of 8

Issues with Application.DisplayAlert = False

  1. #1
    Registered User
    Join Date
    10-20-2012
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Issues with Application.DisplayAlert = False

    Hi Community;

    First of all I want to introduce myself, my name is Euro and I'm a Macro programmer beginner, having said that I want to thank all the forum community for the amazing amount of information that it is available here, even if this is my first post I ve been browsing the forums for knowledge for some days now.

    Having said that, let s go to the point. This is the first Macro that I'm writing, and what it does is basically downloads data from the internet and arranges it in the appropiate format to create a Pivot Table from the database. I'm pretty satisfied with its performance, but I want to remove the annoying alert when it closes the workbook "Do you Want to save?" etc. In order to not have to be clicking the alerts while it downloads. However, when I add the Application.DisplayAlert = False into my code, the macro fails to copy the information to the database spreadsheet. The error is "1004 Microsoft Excel Cannot paste the data" (On the Underlined + Bold Statement below).
    My Code :

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 10-25-2012 at 11:51 AM. Reason: Please use code tags...Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Issues with Application.DisplayAlert = False

    How about:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Issues with Application.DisplayAlert = False

    There is no real need for this line in your Code:

    Please Login or Register  to view this content.
    I would just delete it.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Issues with Application.DisplayAlert = False

    @Winon: That is his current codeline of choice to close the reference file he opened. None of this is really how it should be done.


    @Euro: Can you decribe briefly what your macro actually does, specifically? I can guess at most of it, but your description would help. We can probably give you a much more succinct macro to do this.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Issues with Application.DisplayAlert = False

    @ JBeaucaire,

    That is his current codeline of choice to close the reference file he opened.
    But you may suggest:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-20-2012
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Issues with Application.DisplayAlert = False

    Hi All, Thanks for your reply!
    Actually, now the macro decided to function with the original code described above, I don't know why it wouldn't work in the first place because I was just adding a command to not have to click manually on the windows alert.
    Basically there is an input table, where you put the specifications of the information you want to download, there is a column with a text managing formula that creates the link to the specified information, the macro basically opens the internet source copies the info from the temporary excel file and sorts it into a spreadsheet on the file on a format that will allow the creation of a pivot table on the future.
    Regarding omitting the closewindow would leave numerous temporary excel files open, as the macro sorts the input table and opens the different links.

  7. #7
    Registered User
    Join Date
    10-20-2012
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Issues with Application.DisplayAlert = False

    I notice that you are astonished with the messiness of my code, please understand that I'm teaching myself and have only a couple of months of experience, I will appreciate any sugestion and constructive critic, that helps me be to a better developer.

  8. #8
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Issues with Application.DisplayAlert = False

    Yes it definitely needs structure. Look at all the examples of coding the forum contributors submit and you will see a big difference. Good job with the coding it is just that you need structure. You will get better trust me especially when you have to debug it yourself.

    LeapingLizards

+ 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