Solved

Error Continue in Excel VBA

Posted on 2007-11-20
2
948 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

786 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