Results 1 to 6 of 6

Thread: Update Link

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    20

    Update Link

    Hi,

    Code:
    jet = InputBox("Please key in the range example Q:Q", "Column to Grab")
    mypath = InputBox("File Location", "Jen")
    fname = Dir(mypath & "\" & "*.xls")
    Do While Len(fname) > 0
    Set wb = Workbooks.Open(mypath & "\" & fname)
    
    'i do all my stuff here
    
    wb.Activate
    wb.Close
    
    fname = Dir
    
    Loop
    The above code is to grab all the files in a folder and when it is grabbing all the files, it will prompt up whether i wanted to update the link. I have 100+ files that I need to open and i need to click 100+ times "Don't Update".

    I've tried "Select Case" and "Update Link = 0", i just don't get it right. hope someone can help me..thankss

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Update Link

    wb.close false
    your description is really not clear, but i believe the above is what you want
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    20

    Re: Update Link

    Dear West,

    When i tried to open multiple files, the update link msg box will pop up and ask whether to "Update" or "Don't Update".

    Kindly refer to attachment.


    So, I need to click "Don't Update" each time the macro i run open the workbook.

    I hope the above is clear.

    Thanks
    Attached Images Attached Images  

  4. #4
    Hyperactive Member
    Join Date
    Oct 2010
    Location
    Indiana
    Posts
    457

    Re: Update Link

    That sounds like your security settings, I am more familiar with them in Office 2007, but there are settings to automatically allow the links to update.

    You can also do it programatically through the open method, I didn't test this, but you can refer to the MSDN open reference listed at the bottom.

    The second option for the .open method is for updating...
    Code:
    Set wb = Workbooks.Open(mypath & "\" & fname, True)
    Select the first link "Open Method as it applies to Workbook Objects"
    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Update Link

    you can try application.displayalerts = false
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    20

    Re: Update Link

    i've tried it already but it didn't work.

Posting Permissions

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



Click Here to Expand Forum to Full Width