#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Links

I have a series of weekly financial reports that are always named like this
"Weekly report Week "&<WeekNo.&".xls" I've written a macro on a summary
document that prompts the user to select the week they want to summarize and
change the link to reference the new week. I change the link using the
ActiveWorkbook.ChangeLink Name:="X:\Weekly report Week 01.xls",
NewName:=NewLinkName, Type:=xlExcelLinks method. The problem is that when the
user opens the .xlt file and selects a week everything works normally but if
they change the week and then change it again the code breaks because there
is now no link named "X:\Weekly report Week 01.xls" How can you get a list of
the links in an excel file without using an add-on?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Links

It looks like you could cycle through all the links looking for "weekly report"
(or even more??).

I stole the code from VBA's help and modified it to go through all the links:

Option Explicit
Sub testme02()

Dim astrLinks As Variant
Dim iCtr As Long

astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLi nks)

If IsArray(astrLinks) Then
For iCtr = LBound(astrLinks) To UBound(astrLinks)
If InStr(1, astrLinks(iCtr), "weekly report", _
vbTextCompare) 0 Then
'do the change
End If
Next iCtr
End If

End Sub



gwhenning wrote:

I have a series of weekly financial reports that are always named like this
"Weekly report Week "&<WeekNo.&".xls" I've written a macro on a summary
document that prompts the user to select the week they want to summarize and
change the link to reference the new week. I change the link using the
ActiveWorkbook.ChangeLink Name:="X:\Weekly report Week 01.xls",
NewName:=NewLinkName, Type:=xlExcelLinks method. The problem is that when the
user opens the .xlt file and selects a week everything works normally but if
they change the week and then change it again the code breaks because there
is now no link named "X:\Weekly report Week 01.xls" How can you get a list of
the links in an excel file without using an add-on?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Links


Hello, i have a simlar querie,

i have two spreadsheets (spreadsheet1 + spreadsheet2) holdin
identical information but the two spreadsheets sort the informatio
into different workbooks depending on two different dates. i would lik
a vb that means i only have to put the information into spreadsheet1 an
it to put itself inthe corect workbook in spreadsheet2. is thi
possible?

in spread sheet 1 the information is put in order of the date w
recieve the file

in spread sheet 2 the information is put in order of the date we finis
with the file.

we have a workbook for each month. i need the info in spread sheet 1 t
put itself in the right month (workbook) in spreadsheet 2,

hope you can understand what i mean.

thank you

David

--
David
-----------------------------------------------------------------------
David M's Profile: http://www.excelforum.com/member.php...fo&userid=2655
View this thread: http://www.excelforum.com/showthread.php?threadid=40055

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

Putting the data in two spots is usually a problem--always a problem for me.

I'd put the data in one location and use Data|Sort or Data|Filter|autofilter to
see different "views" of the data.



David M wrote:

Hello, i have a simlar querie,

i have two spreadsheets (spreadsheet1 + spreadsheet2) holding
identical information but the two spreadsheets sort the information
into different workbooks depending on two different dates. i would like
a vb that means i only have to put the information into spreadsheet1 and
it to put itself inthe corect workbook in spreadsheet2. is this
possible?

in spread sheet 1 the information is put in order of the date we
recieve the file

in spread sheet 2 the information is put in order of the date we finish
with the file.

we have a workbook for each month. i need the info in spread sheet 1 to
put itself in the right month (workbook) in spreadsheet 2,

hope you can understand what i mean.

thank you

David,

--
David M
------------------------------------------------------------------------
David M's Profile: http://www.excelforum.com/member.php...o&userid=26556
View this thread: http://www.excelforum.com/showthread...hreadid=400557


--

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
Edit Links: Changing links on a protected worksheet Halibut68 Excel Discussion (Misc queries) 0 April 28th 06 11:03 AM
EXCEL - LINKS cannot easily get list of all links & names in book Tuba Joe Excel Worksheet Functions 1 September 29th 05 10:33 PM
can't update links...can't find links GJR3599 Excel Discussion (Misc queries) 1 April 4th 05 04:56 PM


All times are GMT +1. The time now is 10:54 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"