اذهب الي المحتوي
أوفيسنا

كود لمعرفة مصدر لينك


الردود الموصى بها

السلام عليكم

الاخوة الكرام والاساتذة العظام

جمعة مباركة عليكم جميعا

هلى يوجد كود طريقة يمكن بها معرفة مصدر اللينك الموجود فى الملف 

جزاك الله كل الخير

 

رابط هذا التعليق
شارك

استاذ ابو حنين وجدت هذا الكود على النت
ارجو يكون المقصود
 
Sub ShowAllLinksInfo()
'Author:        JLLatham
'Purpose:       Identify which cells in which worksheets are using Linked Data
'Requirements:  requires a worksheet to be added to the workbook and named LinksList
    Dim aLinks           As Variant
    Dim i                As Integer
    Dim Ws               As Worksheet
    Dim anyWS            As Worksheet
    Dim anyCell          As Range
    Dim reportWS         As Worksheet
    Dim nextReportRow    As Long
    Dim shtName          As String
 
    shtName = "LinksList"
 
    'Create the result sheet if one does not already exist
    For Each Ws In Application.Worksheets
        If Ws.Name = shtName Then bWsExists = True
    Next Ws
    If bWsExists = False Then
        Application.DisplayAlerts = False
        Set Ws = ActiveWorkbook.Worksheets.Add(Type:=xlWorksheet)
        Ws.Name = shtName
        Ws.Select
        Ws.Move After:=ActiveWorkbook.Worksheets(ActiveWorkbook.Worksheets.Count)
        Application.DisplayAlerts = True
    End If
 
    'Now start looking of linked data cells
    Set reportWS = ThisWorkbook.Worksheets(shtName)
    reportWS.Cells.Clear
    reportWS.Range("A1") = "Worksheet"
    reportWS.Range("B1") = "Cell"
    reportWS.Range("C1") = "Formula"
 
    aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
    If Not IsEmpty(aLinks) Then
        'there are links somewhere in the workbook
        For Each anyWS In ThisWorkbook.Worksheets
            If anyWS.Name <> reportWS.Name Then
                For Each anyCell In anyWS.UsedRange
                    If anyCell.HasFormula Then
                        If InStr(anyCell.formula, "[") > 0 Then
                            nextReportRow = reportWS.Range("A" & Rows.Count).End(xlUp).Row + 1
                            reportWS.Range("A" & nextReportRow) = anyWS.Name
                            reportWS.Range("B" & nextReportRow) = anyCell.Address
                            reportWS.Range("C" & nextReportRow) = "'" & anyCell.formula
                        End If
                    End If
                Next    ' end anyCell loop
            End If
        Next    ' end anyWS loop
    Else
        MsgBox "No links to Excel worksheets detected."
    End If
    'housekeeping
    Set reportWS = Nothing
    Set Ws = Nothing
End Sub
  • Like 1
  • Thanks 1
رابط هذا التعليق
شارك

السلا م عليكم

جزاك الله خير ااخى العزيز

على وقتك ومجودك واهتمامك 

الا انى استخدمت الكود

وما زال الملف يخبرنى انه يرد عمل update

ولا اعلم مصدر اللينك اين

جزاك الله خيرا اخى الكريم

رابط هذا التعليق
شارك

كل المطلوب

هو عند فتح الملف ويطلب التحديث اعطي امر التحديث سوف يأتي مربع اخر به اختيارين متابعه و تحرير الارتباطات اضغط علي تحرير الارتباطات سوف يعرض لك كل الارتباطات ومكانها ومصدرها

تقبل تحياتي

رابط هذا التعليق
شارك

من فضلك سجل دخول لتتمكن من التعليق

ستتمكن من اضافه تعليقات بعد التسجيل



سجل دخولك الان
  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information