Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default UpdateLink Question

In a workbook on my local PC I have a commandbutton to update links from a
workbook located on a server. The code is shown below. If the connection to
the server is broken and I click the button I get a windows dialog window
which prompts me for the filename of the remote workbook. I have added
errorhandling, but that only fires when i click Cancel in the above
mentioned window.
So my question is: How can I set this up so the user gets informed that the
network connection is lost ?


Sub OppdaterFraTSPC()
'Oppfrisker data fra TSPC-arbeidsboka

On Error GoTo ErrorHandler

ActiveWorkbook.UpdateLink Name:= _
"G:\DRSENT\02.Ukerapporter\TSPC rapporter\Avregningsrapport Ekstern
Leveranse.xls" _
, Type:=xlExcelLinks

Exit Sub

ErrorHandler:
MsgBox "Oppdatering ikke tilgjengelig, bruk/modifiser eksisterende
data.", vbCritical, "Noe gikk galt..."

End Sub


mvh
Knut Egil


  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default UpdateLink Question

Hi Knut;

I found the following example in Excel VBA Help to user a
combination of the timer method along with Do Events.

Thanks,

Greg


Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes
Then
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.
MsgBox "Paused for " & TotalTime & " seconds"
Else
End
End If



-----Original Message-----
In a workbook on my local PC I have a commandbutton to

update links from a
workbook located on a server. The code is shown below. If

the connection to
the server is broken and I click the button I get a

windows dialog window
which prompts me for the filename of the remote workbook.

I have added
errorhandling, but that only fires when i click Cancel in

the above
mentioned window.
So my question is: How can I set this up so the user gets

informed that the
network connection is lost ?


Sub OppdaterFraTSPC()
'Oppfrisker data fra TSPC-arbeidsboka

On Error GoTo ErrorHandler

ActiveWorkbook.UpdateLink Name:= _
"G:\DRSENT\02.Ukerapporter\TSPC

rapporter\Avregningsrapport Ekstern
Leveranse.xls" _
, Type:=xlExcelLinks

Exit Sub

ErrorHandler:
MsgBox "Oppdatering ikke tilgjengelig, bruk/modifiser

eksisterende
data.", vbCritical, "Noe gikk galt..."

End Sub


mvh
Knut Egil


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default UpdateLink Question

Thank you ??? but how is this related to my question?????

Knut Egil

skrev i melding
...
Hi Knut;

I found the following example in Excel VBA Help to user a
combination of the timer method along with Do Events.

Thanks,

Greg


Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes
Then
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.
MsgBox "Paused for " & TotalTime & " seconds"
Else
End
End If



-----Original Message-----
In a workbook on my local PC I have a commandbutton to

update links from a
workbook located on a server. The code is shown below. If

the connection to
the server is broken and I click the button I get a

windows dialog window
which prompts me for the filename of the remote workbook.

I have added
errorhandling, but that only fires when i click Cancel in

the above
mentioned window.
So my question is: How can I set this up so the user gets

informed that the
network connection is lost ?


Sub OppdaterFraTSPC()
'Oppfrisker data fra TSPC-arbeidsboka

On Error GoTo ErrorHandler

ActiveWorkbook.UpdateLink Name:= _
"G:\DRSENT\02.Ukerapporter\TSPC

rapporter\Avregningsrapport Ekstern
Leveranse.xls" _
, Type:=xlExcelLinks

Exit Sub

ErrorHandler:
MsgBox "Oppdatering ikke tilgjengelig, bruk/modifiser

eksisterende
data.", vbCritical, "Noe gikk galt..."

End Sub


mvh
Knut Egil


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default UpdateLink Question

PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime


This little bit of code will cause the loop to run for 5 *days*.
I suspect you want something like

Do While Timer < Start + TimeSerial(0,0,PauseTime)

But as noted elsewhere, it is wholely irrelevant to the original
poster's question.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



wrote in message
...
Hi Knut;

I found the following example in Excel VBA Help to user a
combination of the timer method along with Do Events.

Thanks,

Greg


Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes
Then
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.
MsgBox "Paused for " & TotalTime & " seconds"
Else
End
End If



-----Original Message-----
In a workbook on my local PC I have a commandbutton to

update links from a
workbook located on a server. The code is shown below. If

the connection to
the server is broken and I click the button I get a

windows dialog window
which prompts me for the filename of the remote workbook.

I have added
errorhandling, but that only fires when i click Cancel in

the above
mentioned window.
So my question is: How can I set this up so the user gets

informed that the
network connection is lost ?


Sub OppdaterFraTSPC()
'Oppfrisker data fra TSPC-arbeidsboka

On Error GoTo ErrorHandler

ActiveWorkbook.UpdateLink Name:= _
"G:\DRSENT\02.Ukerapporter\TSPC

rapporter\Avregningsrapport Ekstern
Leveranse.xls" _
, Type:=xlExcelLinks

Exit Sub

ErrorHandler:
MsgBox "Oppdatering ikke tilgjengelig, bruk/modifiser

eksisterende
data.", vbCritical, "Noe gikk galt..."

End Sub


mvh
Knut Egil


.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
UpdateLink password protected files, VBA for Excel, tp Links and Linking in Excel 1 July 14th 05 01:56 PM
UpdateLink Method Ray[_8_] Excel Programming 0 July 10th 03 02:46 PM


All times are GMT +1. The time now is 12:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"