Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default test for exernal links

Is it possible to test if a workbook has external links to another workbookl

what i am trying to do is display a message when a user closes a workbook
saying the workbook has external links.

How would i code this??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default test for exernal links

I believe there is a security setting that does this check when the workbook
opens(Excel 2007).



"hervinder" wrote in message
...
Is it possible to test if a workbook has external links to another
workbookl

what i am trying to do is display a message when a user closes a workbook
saying the workbook has external links.

How would i code this??


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default test for exernal links

unfortunately i'm still using excel 2003

all i want is something along the lines of

if activeworkbook.externallinks = true then msgbox "this book contains
external links"

if only it was as easy as that


"Dennis Tucker" wrote:

I believe there is a security setting that does this check when the workbook
opens(Excel 2007).



"hervinder" wrote in message
...
Is it possible to test if a workbook has external links to another
workbookl

what i am trying to do is display a message when a user closes a workbook
saying the workbook has external links.

How would i code this??


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default test for exernal links

I'm not sure what you want to do, but maybe...

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim myLinks As Variant
Dim iCtr As Long

myLinks = Me.LinkSources(xlExcelLinks)
If IsEmpty(myLinks) Then
'do nothing
Else
Msgbox "it has links!"
'maybe loop thrugh them (as an example
For iCtr = LBound(myLinks) To UBound(myLinks)
MsgBox myLinks(iCtr)
Next iCtr
End If

End Sub

This code goes into the ThisWorkbook module of the workbook's project.

hervinder wrote:

Is it possible to test if a workbook has external links to another workbookl

what i am trying to do is display a message when a user closes a workbook
saying the workbook has external links.

How would i code this??


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default test for exernal links

thanks dave

works a treat

"Dave Peterson" wrote:

I'm not sure what you want to do, but maybe...

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim myLinks As Variant
Dim iCtr As Long

myLinks = Me.LinkSources(xlExcelLinks)
If IsEmpty(myLinks) Then
'do nothing
Else
Msgbox "it has links!"
'maybe loop thrugh them (as an example
For iCtr = LBound(myLinks) To UBound(myLinks)
MsgBox myLinks(iCtr)
Next iCtr
End If

End Sub

This code goes into the ThisWorkbook module of the workbook's project.

hervinder wrote:

Is it possible to test if a workbook has external links to another workbookl

what i am trying to do is display a message when a user closes a workbook
saying the workbook has external links.

How would i code this??


--

Dave Peterson
.



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
Slow opening links between workbooks with links created in 2003 Russell Excel Discussion (Misc queries) 0 December 14th 09 02:59 PM
Update links box gives Continue or Edit Links dialog KarenF Excel Discussion (Misc queries) 0 May 18th 07 01:17 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM
EXCEL - LINKS cannot easily get list of all links & names in book Tuba Joe Excel Worksheet Functions 1 September 29th 05 10:33 PM
Help needed to test and modify interworkbook links Aaron Cooper Excel Programming 4 April 14th 04 02:53 PM


All times are GMT +1. The time now is 12:18 PM.

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"