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

Hello all,
Can anyone help please?

I have a spreadsheet that rolls forward on a weekly basis.
Much of the data is pulled in from other spreadsheets
which also roll forward on a weekly basis.

The following is the code i use:

secondFilename = "C:\headoffice\"
secondFilename = secondFilename & CStr(Range
("D2").Value)
secondFilename = secondFilename & "_04_abc.xls"

thirdFilename = "C:\headoffice\"
thirdFilename = thirdFilename & CStr(Range
("D2").Value)
thirdFilename = thirdFilename & "_04_def.xls"

Range("X1").Select
Selection.Copy
Range("D2").Select
Selection.pastespecial Paste:=xlPasteValues,
Operation:=xlAdd, SkipBlanks:=False, Transpose:=False

fourthFilename = "C:\headoffice\"
fourthFilename = fourthFilename & CStr(Range
("D2").Value)
fourthFilename = fourthFilename & "_04_abc.xls"

ActiveWorkbook.ChangeLink secondFilename,
fourthFilename, xlLinkTypeExcelLinks

D2 represents the week no.

The sheet can roll forward for weeks without problem and
then i get an error as follows:

Run Time Error
Method 'ChangeLink' of object'_Workbook' failed

and the macro stops on the line:
ActiveWorkbook.Changelink secondFilename, fourthFilename,
xlLinkTypeExcelLinks

Can anyone tell me why this is happening?

Any help much appreciated

Cheers

Joe


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
ChangeLink Joe Bannister[_2_] Excel Programming 0 January 12th 04 03:29 PM
ChangeLink Joe Bannister Excel Programming 1 December 1st 03 02:55 PM
ChangeLink command Abdul Salam Excel Programming 0 July 14th 03 10:13 AM
ChangeLink xlExcelLinks Joe Bannister Excel Programming 0 July 10th 03 04:20 PM


All times are GMT +1. The time now is 09:34 PM.

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

About Us

"It's about Microsoft Excel"