Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 2
Default Moving OLE/XLINK and HyperLinks to a new NAS

hi all

Does anyone know how I can resolve this issue ... I have a NAS (FILER) which
over 5000 !!!worksheets which have links to external data (Shares, UNC and
also Hyperlinks)

-- I need to copy these files into a New NAS, If
I do a simple Cut & Past, the Reference Link to the Spreadsheet gets
moved to the New Directory (where the file does not exist), but if I open
the worksheet (in the original directory/location) and Save As to the New
Directory, the worksheet saved in the New Directory maintains its link to
the Master Spreadsheet in the original directory/location. I hope I've
explained this clearly.

Here's my problem -- it's a bit time consuming to have to open each and
every worksheet and Save As to the New Location -- I'm not sure if a VB /
VBS or Batch
File (or Dos Command xcopy) would solve this --

Is there some code I could use to Open each worksheet search for the old NAS
and replace it with the new NAS Share ?

Many Thanks in Advance.

this is the code to show the links



ttribute VB_Name = "Module1"
Option Explicit

Public Sub main()
Dim objExcel As Object ' Excel.Application
Dim objWork As Object ' Excel.Workbook
Dim objSheet As Object ' Excel.Worksheet
Dim objHyperlink As Object ' Excel.Hyperlink
Dim aLinks As Variant
Dim intC1 As Integer
Dim intSheetIndex As Integer

Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = False
Set objWork = objExcel.Workbooks.Open(FileName:="c:\test\swfeb02 .xls",
UpdateLinks:=0, IgnoreReadOnlyRecommended:=True)
aLinks = objWork.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For intC1 = 1 To UBound(aLinks)
Debug.Print "XLLINK:" & aLinks(intC1)
Next
End If
aLinks = objWork.LinkSources(xlOLELinks)
If Not IsEmpty(aLinks) Then
For intC1 = 1 To UBound(aLinks)
Debug.Print "OLELINK:" & aLinks(intC1)
Next
End If
For Each objSheet In objWork.Worksheets
For Each objHyperlink In objSheet.Hyperlinks
Debug.Print "HYPERLINK:" & objHyperlink.Address
Next
Next
objExcel.DisplayAlerts = False
objWork.Close savechanges:=False

End Sub

cheers

klaus






  #2   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 2
Default Moving OLE/XLINK and HyperLinks to a new NAS

additional Information

I know the ChangeLink Functions but it looks like the functions does not
really work
has anybody a workaround ? (Google Search show a many many problems)

regards
klaus



"Klaus Bilger" schrieb im Newsbeitrag
...
hi all

Does anyone know how I can resolve this issue ... I have a NAS (FILER)
which
over 5000 !!!worksheets which have links to external data (Shares, UNC and
also Hyperlinks)

-- I need to copy these files into a New NAS, If
I do a simple Cut & Past, the Reference Link to the Spreadsheet gets
moved to the New Directory (where the file does not exist), but if I open
the worksheet (in the original directory/location) and Save As to the New
Directory, the worksheet saved in the New Directory maintains its link to
the Master Spreadsheet in the original directory/location. I hope I've
explained this clearly.

Here's my problem -- it's a bit time consuming to have to open each and
every worksheet and Save As to the New Location -- I'm not sure if a VB /
VBS or Batch
File (or Dos Command xcopy) would solve this --

Is there some code I could use to Open each worksheet search for the old
NAS and replace it with the new NAS Share ?

Many Thanks in Advance.

this is the code to show the links



ttribute VB_Name = "Module1"
Option Explicit

Public Sub main()
Dim objExcel As Object ' Excel.Application
Dim objWork As Object ' Excel.Workbook
Dim objSheet As Object ' Excel.Worksheet
Dim objHyperlink As Object ' Excel.Hyperlink
Dim aLinks As Variant
Dim intC1 As Integer
Dim intSheetIndex As Integer

Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = False
Set objWork = objExcel.Workbooks.Open(FileName:="c:\test\swfeb02 .xls",
UpdateLinks:=0, IgnoreReadOnlyRecommended:=True)
aLinks = objWork.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For intC1 = 1 To UBound(aLinks)
Debug.Print "XLLINK:" & aLinks(intC1)
Next
End If
aLinks = objWork.LinkSources(xlOLELinks)
If Not IsEmpty(aLinks) Then
For intC1 = 1 To UBound(aLinks)
Debug.Print "OLELINK:" & aLinks(intC1)
Next
End If
For Each objSheet In objWork.Worksheets
For Each objHyperlink In objSheet.Hyperlinks
Debug.Print "HYPERLINK:" & objHyperlink.Address
Next
Next
objExcel.DisplayAlerts = False
objWork.Close savechanges:=False

End Sub

cheers

klaus








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
hyperlinks - macro not working to take them off the sheet Lorelei New Users to Excel 1 September 23rd 06 02:18 AM
Moving workbook to memory stick - hyperlinks fail Brucear Excel Discussion (Misc queries) 2 September 18th 06 12:32 AM
Moving Excel Spreadsheets with hyperlinks in them Drew Excel Discussion (Misc queries) 0 August 2nd 06 09:12 PM
Help with hyperlinks in pulldown list. Anyone know how? Wayne Knazek Excel Discussion (Misc queries) 0 June 26th 06 04:29 PM
creating and moving hyperlinks - Please help!!!! hssmith Excel Worksheet Functions 0 September 16th 05 07:46 PM


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