Solved

Error Continue in Excel VBA

Posted on 2007-11-20
2
957 Views
Last Modified: 2008-02-01
This is Excel 2003.
I have this “File” that I have linked to and I need to save every 13 seconds to keep it live.  

But sometimes the original file is saving and my procedure errors out.   How do you tell it to   “ If  error then continue” without popping up the error, so I don’t have to manually do it.

Any help would greatly be appreciated.
'//////////////////////////////////////////////////////////
Sub UpdateLinks()'

    ActiveWorkbook.UpdateLink Name:= _
        "\\DTCNAS-ILSP002\Test.xls" _
        , Type:=xlExcelLinks
    Range("A1").Select
   
    Call UpdateTime
End Sub


Sub UpdateTime()

Application.OnTime Now + TimeValue("00:00:13"), "UpdateLinks"

End Sub
0
Comment
Question by:ca1358
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Expert Comment

by:Michael_D
ID: 20322464
Try this


Sub UpdateLinks()'
 
On Error GoTo ErrorHandler
 
    ActiveWorkbook.UpdateLink Name:= _
        "\\DTCNAS-ILSP002\Test.xls" _
        , Type:=xlExcelLinks
    Range("A1").Select
   
    Call UpdateTime
ErrorHandler:
    ' Do whatever want to do if error occures
End Sub

Open in new window

0
 
LVL 17

Accepted Solution

by:
Shanmuga Sundaram earned 500 total points
ID: 20402000
Though using "On Error Resume Next" is not advicable during in need we can use them.

Sub UpdateLinks()'
On Error Resume Next
    ActiveWorkbook.UpdateLink Name:= _
        "\\DTCNAS-ILSP002\Test.xls" _
        , Type:=xlExcelLinks
    Range("A1").Select
   
    Call UpdateTime
End Sub


Sub UpdateTime()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:13"), "UpdateLinks"
End Sub
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month5 days, 9 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question