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??
0
Utf
3/15/2010 2:27:01 PM
excel.programming 6508 articles. 2 followers. Follow

4 Replies
586 Views

Similar Articles

[PageSpeed] 6

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



"hervinder" <hervinder@discussions.microsoft.com> wrote in message 
news:08A95302-287D-4E91-A841-84F44CA309A4@microsoft.com...
> 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?? 

0
Dennis
3/15/2010 2:33:40 PM
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
0
Dave
3/15/2010 2:57:48 PM
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" <hervinder@discussions.microsoft.com> wrote in message 
> news:08A95302-287D-4E91-A841-84F44CA309A4@microsoft.com...
> > 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?? 
> 
> .
> 
0
Utf
3/15/2010 3:29:01 PM
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
> .
> 
0
Utf
3/15/2010 3:48:01 PM
Reply:

Similar Artilces:

Account not linked to budget
I have a checking, savings accounts (banking type), a credit card account (credit card type) and 2 cash accounts (cash type) all attached to my monthly budget. I also have 2 different Line of Credit accounts (liability type) that I can not seem to attach to my budget. If I write a check for something from one of the Line of Credit accounts, the payment and category is not recorded in the budget. When I edit my budget and choose "accounts included in the budget summary", the 2 line of credit accounts do not show up. Any ideas? Have I chosen the wrong account type for these...

Linking Tasks
How do I constrain Task 3 to start and finish as follows: Tasks 2 and 3 start as soon as Task 1 is completed. Task 3 finishes 2 weeks after Task 2 is completed. I'm setting the predecessors for Task 3 as follow => 1,2FF+2 wks. Finish day is calculated correctly but the start date moves to match the default duration. Thanks in advance, Diana This is a varaiation on a Hammock task. The start is driven by 1FS and the finish is driven by 2FF+2wks. What would do is estblish an intermediate milestone between 2 & 3 called "Task 3 may finish" (or somethin...

Link for downloads???
Everything seems to have changed on Microsofts pages and now it seems almost impossible to find anything. Does anyone have a link to the hotfix and service pack for RMS? I can't find it and do have a service plan.... It appears they have changed the pages to invalid links or the server(s) are down. The same problem happens on both customer and partner source. I sent an e-mail to report the issue. Maybe they will have it corrected tomorrow. "Pete" wrote: > Everything seems to have changed on Microsofts pages and now it seems almost > impossible to find anything. Do...

Excel links #6
I have a word document that I have a link to an excel worksheet with. I need to know how to make the Excel worksheet fit on the correct page width for a word doc. In Excel it fits on one page width. But when I link it, it doesn't fit the width. This is due for a client today I need help. Hi, Can't you select it and drag to resize?? jr >-----Original Message----- >I have a word document that I have a link to an excel >worksheet with. I need to know how to make the Excel >worksheet fit on the correct page width for a word doc. > >In Excel it fits on one p...

Outlook 2003 and opening link question
I'm wanting to change the way Outlook 2003 opens links/webpages - from opening them in Explorer to Firefox. Please guide me to where the option to change this is. Thanks in advance! There is no such setting in Outlook; set Firefox as your default browser. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "Ben" <bswong@bigpond.net.au> wrote in message news:%xboj.9252$421.7874@news-serv...

Link Rows Between Worksheets
Hi- I am trying to link rows (that are infinitely long in terms of data) between two different worksheets so that I dont have to retype all of the data. (I want them to be active links, so that if the data changes, it will automatically update). Is there a way to do this? (The first worksheet is a master that has a whole lot of information, and I would like the other worksheets to reference rows from the original...) Thank you very very much.. In the other sheets you will have to set then up eg: in sheet2 select the cell you want then type an equals sign = got to master sheet and se...

Click on link problems #2
When I click on a url link in email---a box opens saying "Open Link Browser". And also a browser window. How do I get rid of the smaller link browser? Read your reply on your post of the 17th? -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -What do the Outlook Icons Mean? -Create an Office 2003 CD slipstreamed with Service Pack 1 ----- "Robin" <robinhood2@juno.com> wrote in message news:atmnk0pgs4m272iunkegt0rvq4ssjqisig@4ax.com... > When I click on a url link in email---a box opens saying "Open Link > Browser". A...

Customize link not working in Reports
Money 2002: Version 10.0 When I open a report (any report) and then choose the Customize... link on the left side, I do not get the Customize Dialog box that I used to see. Money is basically unusable until I hit the ESC (Escape) key. Any ideas? If you are using Money 2005, go into Tools/Reports and see whether you are using Essential or Advanced Reports. My guess is that you need to switch from Essential to Advanced. This is new in Money 2005. "LongTime User" wrote: > Money 2002: Version 10.0 > > When I open a report (any report) and then choose the Customize....

Can't click through on links in e-mail
Ever since one of those "critical upgrades" we have been unable to click through to a web page from links in e-mail. This is a real pain for links that say "click here" rather than the URL. A blank, white Explorer session opens along with an error window that says "Locate Browser Link" with a cursor blinking in the "file name" field. Any help? TIA Bob Should have mentioned that we are running XP Home edition V5.1 and Outlook 2002 (not Outlook Express) SP-2. "Bob" <usenetsp_mtrap@hotmail.com> wrote in message news:#TpOgKQyDHA.246...

Test
Test only ...

Test managed user
Testing again to see if my set up is correct to identify me as managed user. ------=_NextPart_0001_26B25925 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, This email came in under Open- Managed User. Please let me know if you have further questions. Thanks, Dana Dunlop Microsoft Online Support Engineer ====================================================== PLEASE NOTE: The partner managed newsgroups are provided to assist with break/fix issues and simple how to questions. We also love to hear your product feedback! Let us know what you think by posting ...

Link to Worksheet
As soon as I open my worksheet it open 'open dialog box' looking for file. It has peicharts, trendcharts and data, I don't know which one i linked. I want to remove the link, how can I -- Message posted from http://www.ExcelForum.com Get a copy of Bill Manville's FindLink program: http://www.bmsltd.ie/MVP/Default.htm You'll be happy once again! "anupam <" wrote: > > As soon as I open my worksheet it open 'open dialog box' looking for a > file. It has peicharts, trendcharts and data, I don't know which one is > linked. I want to r...

Epson Stylus NX515 does not print, not even a Test page
I use Windows 7 and the Epson Stylus NX515 is on and the wireless light is also on. But it does not print. The documents are in the queue but do not print. Not even a test page. Here is a link to Epson trouble shooting site. Make sure when you want to print you pick your printer if there is a list of printers. "Ritter197" wrote: > I use Windows 7 and the Epson Stylus NX515 is on and the wireless light is > also on. But it does not print. The documents are in the queue but do not > print. Not even a test page. > > . > http://www.epson.com...

how to link a .txt ( .dat) as a table by VB
Hi from Meudon (France) I want to link a .txt file as a table in my acces db. How to by VB : code and reference(s) (Acces 2003) Thanks by anticipation ...

How to import web link and avoid frame?
Does anyone have any suggestions on how to import web link into Excel and avoid frame on web page? When I browse following link, it look fine on IE, but when I insert this link into excel, it shows nothing, because of frame within HTML. http://www.hkab.org.hk/DisplayInterestSettlementRatesAction.do?Submit=Search&lang=en&year=2010&month=2&day=3 Does anyone have any suggestions on how to solve it within Excel? Thanks in advance for any suggestions Eric When I right click on the sheet>import to excel, I get. You can the record a macro to refresh. Rates ...

Testing encoding
This is Czech encoding test - please delete +��������= ��������� -- Technicka Podpora Diskusnich Skupin Microsoft Ceska Republika a Slovensko http://support.microsoft.com http://www.microsoft.com/cze ...

Resources
I understand there is a feature in Great Plains where I can pull up any screen in eEnterprise and see what column and table that text box is linked to? Is this true? What are the steps to get this information? ...

test #5
test ...

Migrating Exchange Test Environment
Ok, here we go I want to migrate an Ex server to another server with a different name. As I see it there are a number of different ways I can go about doing this. I want to make this a recovery learning experience so I am asking which is the best way to go about it without restoring from backup. Should I shut down the EX services and copy the databases to the new server (this would simulate a dead server with a good drive). What are the best ways to go about recovering/migrating this server. -Harry If it's a test environment then just do it. You'll learn better that way! An...

How can I transpose a paste link?
I would like to link one long row of cells from one worksheet to one long column of cells on another. I have to do this in many cases, so paste-linking one cell at a time is not feasible. How can I transpose a paste-link operation? Saved from a previous post: You could try this: Copy|paste special|paste link (but in an out of the way location) Then select those cells edit|replace what: = with: $$$$$= (some unique string) replace all. Now those formulas are strings Copy|paste special|transpose select the range edit|replace what: $$$$$= (same string) with: = replace all And clean up...

How can i link arrows with cell?
I had tables.. And in that some cells were pointed by arrows. (One value derived by content of other cell, TO give it a legibility arrow beteen these two cell is used). Now when we copy paste that cells in word.. and change size of area.. Arrow sizes are not scalled down or up. Please let me know how can we do this? TIA Sandip You could copy to Word as picture. Hold down SHIFT, select range and use Edit | Copy as Picture proceed form there best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Sandip" <Sandip@discussions.microsoft.com> wro...

linking machine datasource to MySQ,import tableL-error
Hi I am able create a machine datasource using a MySQL ODBC driver but when I select import and try to import data I get the error , Microsoft Access reserved error (-7701). I used the same driver around 6 months ago and it worked fine. Thanks. -- Paul G Software engineer. Just a bit more information. I ran a trace and get the following, looks like a bad pointer, could it be running out of machine memory! MSACCESS 714-6cc ENTER SQLSetConnectOption HDBC 083715E8 SQLINTEGER 103 <SQL_LOGIN_TIMEOUT> SQLPOINTER 0x00000014 MSACCE...

linking multiple charts from one xcl workbook
I have a ppt presentation that uses six different charts that I created in an excel workbook. I want the charts in the ppt to update every time I enter data into the excel worksheet but when I use the link function "insert->object" it ends up putting the same chart on all the ppt slides rather than the one slide it needs to be on. Any help is appreciated. Insert Object From File inserts the active sheet at the time the file was last saved, or the active sheet at the time the object was inserted, if it is active in Excel at that time. I would recommend that you copy the cha...

Address doesn't show up in address link after importing
I imported a list of 10 contacts into CRM 4. All required information was imported and displayed correctly in the Details->information tab. However, the address information is not showing up in Details->address link. Am I missing some information during import process? Any recomendaion or assistance would be much appreciated. ...

howto only create a .lib file instead of creating/linking a complete dll
hi all, i have a librariy around here that gets compiled and linked to a dll. at the time of linking, visual studio 6 also creates a .lib file. how can i split that compiling/linking ? what i want to achieve is just only to generate this .lib file (because at that time i cant completly link my libs because of its dependencies) i already tried to export the dsp to a makefile and run: nmake -d mylib.dsp /MAKE "mylib - Win32 release but it seems that this also wants to create a .lib and a .dll file at the same time so i tried to run: nmake -d mylib.dsp /MAKE mylib.lib "mylib - Win3...