+ Reply to Thread
Results 1 to 3 of 3

Simplifying my previous question ...

  1. #1
    Guest

    Simplifying my previous question ...

    I suspect that (since I didn't get any response on my previous request for
    assistance) I may need to approach this in stages ...

    Assuming that Information Rights Management (IRM) won't give me the detailed
    permissions I need, basically, here's what I need:

    1. A Macro that will unprotect a series of Workbooks (approximately 200 of
    them) so that the Auto Update function in Linked Data can update without
    user intervention.

    2. I copied this Macro from a previous post -- how can I modify the
    following code to achieve what I need from it:

    Can I use something like this?
    I assume that I'll need something like this to unprotect the affected
    worksheets:
    ActiveSheet.Unprotect Password:="" '<===I assume that I'll enter
    my worksheet password between the ""

    Private Sub Workbook_Open()
    Dim vLinkSources
    Dim iLinkSource As Integer
    vLinkSources = ThisWorkbook.LinkSources(xlExcelLinks)
    If Not IsEmpty(vLinkSources) Then
    For iLinkSource = LBound(vLinkSources) To UBound(vLinkSources)
    ThisWorkbook.UpdateLink vLinkSources(iLinkSource), xlExcelLinks
    Next
    End If
    End Sub

    I'll need to re-protect the affected worksheets upon closing:
    ActiveSheet.Protect Password:="" '<===I assume that I'll enter my
    worksheet password between the ""
    End Sub

    Any help in setting me straight on this would be greately appreciated --
    thanks in advance.



  2. #2
    David McRitchie
    Guest

    Re: Simplifying my previous question ...

    Sure record a macro when you unprotect the sheet, do some things,
    and then protect the sheet again. You will be able to extract
    at the very least the code for unprotecting (which you already have)
    and the code for protecting again. (yes you include the password in the
    code) -- An alternative is to protect the sheet without the password.
    Sometimes the password is entered solely to prevent others from accidentally
    supplying a password in reprotecting the sheet.

    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    <[email protected]> wrote in message news:%23qeyK%[email protected]...
    > I suspect that (since I didn't get any response on my previous request for
    > assistance) I may need to approach this in stages ...
    >
    > Assuming that Information Rights Management (IRM) won't give me the detailed
    > permissions I need, basically, here's what I need:
    >
    > 1. A Macro that will unprotect a series of Workbooks (approximately 200 of
    > them) so that the Auto Update function in Linked Data can update without
    > user intervention.
    >
    > 2. I copied this Macro from a previous post -- how can I modify the
    > following code to achieve what I need from it:
    >
    > Can I use something like this?
    > I assume that I'll need something like this to unprotect the affected
    > worksheets:
    > ActiveSheet.Unprotect Password:="" '<===I assume that I'll enter
    > my worksheet password between the ""
    >
    > Private Sub Workbook_Open()
    > Dim vLinkSources
    > Dim iLinkSource As Integer
    > vLinkSources = ThisWorkbook.LinkSources(xlExcelLinks)
    > If Not IsEmpty(vLinkSources) Then
    > For iLinkSource = LBound(vLinkSources) To UBound(vLinkSources)
    > ThisWorkbook.UpdateLink vLinkSources(iLinkSource), xlExcelLinks
    > Next
    > End If
    > End Sub
    >
    > I'll need to re-protect the affected worksheets upon closing:
    > ActiveSheet.Protect Password:="" '<===I assume that I'll enter my
    > worksheet password between the ""
    > End Sub
    >
    > Any help in setting me straight on this would be greately appreciated --
    > thanks in advance.
    >
    >




  3. #3
    Guest

    Re: Simplifying my previous question ...

    Thanks David -- I'm ALMOST there ...

    Do you see anything that I may be missing? Here's the MOST important thing
    I need this code to do (assuming there are no further modifications needed)
    ....


    This code (Macro) needs to perform this same task on approximately 200
    different Workbooks (all residing in the same Network Directory), but ONLY
    when a Command Button is pressed. I'm assuming that I'll need to create a
    Form (in ACCESS perhaps) and call this Macro -- correct? How would I do
    this, and how would I get this Macro to perform this Link Update on all 200
    or so Workbooks?



    Private Sub Workbook_Open()
    Dim vLinkSources
    Dim iLinkSource As Integer
    Dim AnySheet As Worksheet
    For Each AnySheet In ActiveWorkbook.Worksheets
    ActiveWorkbook.Worksheets(AnySheet.Name).Unprotect
    Password:="mypassword"
    Next
    vLinkSources = ActiveWorkbook.LinkSources(xlExcelLinks)
    If Not IsEmpty(vLinkSources) Then
    For iLinkSource = LBound(vLinkSources) To
    UBound(vLinkSources)
    ActiveWorkbook.UpdateLink vLinkSources(iLinkSource), xlExcelLinks
    Next
    End If
    For Each AnySheet In ActiveWorkbook.Worksheets
    ActiveWorkbook.Worksheets(AnySheet.Name).Protect
    Password:="mypassword"
    Next
    End Sub

    ======================================================

    "David McRitchie" <[email protected]> wrote in message
    news:[email protected]...
    > Sure record a macro when you unprotect the sheet, do some things,
    > and then protect the sheet again. You will be able to extract
    > at the very least the code for unprotecting (which you already have)
    > and the code for protecting again. (yes you include the password in
    > the
    > code) -- An alternative is to protect the sheet without the password.
    > Sometimes the password is entered solely to prevent others from
    > accidentally
    > supplying a password in reprotecting the sheet.
    >
    > ---
    > HTH,
    > David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    > My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    > Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
    >
    > <[email protected]> wrote in message
    > news:%23qeyK%[email protected]...
    >> I suspect that (since I didn't get any response on my previous request
    >> for
    >> assistance) I may need to approach this in stages ...
    >>
    >> Assuming that Information Rights Management (IRM) won't give me the
    >> detailed
    >> permissions I need, basically, here's what I need:
    >>
    >> 1. A Macro that will unprotect a series of Workbooks (approximately 200
    >> of
    >> them) so that the Auto Update function in Linked Data can update without
    >> user intervention.
    >>
    >> 2. I copied this Macro from a previous post -- how can I modify the
    >> following code to achieve what I need from it:
    >>
    >> Can I use something like this?
    >> I assume that I'll need something like this to unprotect the
    >> affected
    >> worksheets:
    >> ActiveSheet.Unprotect Password:="" '<===I assume that I'll
    >> enter
    >> my worksheet password between the ""
    >>
    >> Private Sub Workbook_Open()
    >> Dim vLinkSources
    >> Dim iLinkSource As Integer
    >> vLinkSources = ThisWorkbook.LinkSources(xlExcelLinks)
    >> If Not IsEmpty(vLinkSources) Then
    >> For iLinkSource = LBound(vLinkSources) To UBound(vLinkSources)
    >> ThisWorkbook.UpdateLink vLinkSources(iLinkSource), xlExcelLinks
    >> Next
    >> End If
    >> End Sub
    >>
    >> I'll need to re-protect the affected worksheets upon closing:
    >> ActiveSheet.Protect Password:="" '<===I assume that I'll enter my
    >> worksheet password between the ""
    >> End Sub
    >>
    >> Any help in setting me straight on this would be greately appreciated --
    >> thanks in advance.
    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1