Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default ChangeLink Command Not Working

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks


All variations get the same error message.
I'm running on Windows XP if that makes any difference.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ChangeLink Command Not Working

Are any of your worksheets protected?

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default ChangeLink Command Not Working

No. They are all unprotected and I've Changed Directories (ChDir) to the
proper directory as part of the loop.

"Dave Peterson" wrote:

Are any of your worksheets protected?

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.


--

Dave Peterson

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

Does it work if you do it manually (Edit|links)?

If it works ok, how about recording a macro when you do it there. Maybe it'll
help you debug the problem.

Dina wrote:

No. They are all unprotected and I've Changed Directories (ChDir) to the
proper directory as part of the loop.

"Dave Peterson" wrote:

Are any of your worksheets protected?

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default ChangeLink Command Not Working

I've already tried that. The first sample is the one that the macro
recorded. It worked fine when I did it manually, but when I tried to run it
from the program by calling the macro it crashed.

"Dave Peterson" wrote:

Does it work if you do it manually (Edit|links)?

If it works ok, how about recording a macro when you do it there. Maybe it'll
help you debug the problem.

Dina wrote:

No. They are all unprotected and I've Changed Directories (ChDir) to the
proper directory as part of the loop.

"Dave Peterson" wrote:

Are any of your worksheets protected?

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ChangeLink Command Not Working

Is the workbook protected?

I'm out of guesses.

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default ChangeLink Command Not Working

Thanks for trying.

I've been working on this for 2 days. I had this (or one like it) working
last year on my old computer. I was running Windows 2000. This year I have
Windows XP. The only thing I can think of is that there is a conflict. The
OS sometimes does wonky things to VBA commands.

What forum would I go to for expert help with this kind of conflict?

"Dave Peterson" wrote:

Is the workbook protected?

I'm out of guesses.

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ChangeLink Command Not Working

I'd stay here and see if anybody else could guess.



Dina wrote:

Thanks for trying.

I've been working on this for 2 days. I had this (or one like it) working
last year on my old computer. I was running Windows 2000. This year I have
Windows XP. The only thing I can think of is that there is a conflict. The
OS sometimes does wonky things to VBA commands.

What forum would I go to for expert help with this kind of conflict?

"Dave Peterson" wrote:

Is the workbook protected?

I'm out of guesses.

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default ChangeLink Command Not Working

Did you ever figure this out. I am having the same problem?
--
Thanks!
Shane W


"Dave Peterson" wrote:

I'd stay here and see if anybody else could guess.



Dina wrote:

Thanks for trying.

I've been working on this for 2 days. I had this (or one like it) working
last year on my old computer. I was running Windows 2000. This year I have
Windows XP. The only thing I can think of is that there is a conflict. The
OS sometimes does wonky things to VBA commands.

What forum would I go to for expert help with this kind of conflict?

"Dave Peterson" wrote:

Is the workbook protected?

I'm out of guesses.

Dina wrote:

I have a situation where I am copying files from a "common files" folder into
individual folders. Then I have to change the links to refer to the newly
copied files within each folder. I keep getting "Runtime error '1004'
Method 'ChangeLink' of object '_Workbook' failed"

It doesn't seem to matter whether I use absolute addresses or variables.
I've tried the following:

ActiveWorkbook.ChangeLink Name:= _
"C:\BudDataRun\Common Files\INPUTSHEETABA-GF.xls", NewName:= _
"C:\BudDataRun\Gen Fund Budget\N-E0011\INPUTSHEETABA-GF.xls", Type:= _
xlExcelLinks
(The macro recorder used the Name:= and NewName:= labels)

'ActiveWorkbook.ChangeLink "C:\BudDataRun\Common
Files\INPUTSHEETABA-GF.xls", _
'"INPUTSHEETABA-GF.xls", xlExcelLinks


'ActiveWorkbook.ChangeLink RootDirectoryName & CommonFolder &
ABAFile, _
'RootDirectoryName & FilePathName & FilePathName2 & ABAFile,
xlExcelLinks

All variations get the same error message.
I'm running on Windows XP if that makes any difference.

--

Dave Peterson


--

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
ChangeLink Joe Bannister Excel Programming 2 April 19th 04 09:42 AM
ChangeLink Joe Bannister Excel Programming 0 January 26th 04 09:05 AM
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


All times are GMT +1. The time now is 09:27 AM.

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"