|
-
May 2nd, 2011, 05:10 AM
#1
Thread Starter
Junior Member
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
-
May 3rd, 2011, 09:37 AM
#2
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
-
May 4th, 2011, 08:31 PM
#3
Thread Starter
Junior Member
-
May 4th, 2011, 10:05 PM
#4
Hyperactive Member
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
-
May 5th, 2011, 12:07 AM
#5
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
-
May 5th, 2011, 01:00 AM
#6
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|