Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Events in Excel (Win XP / O2003 UK SP2)

    Hi,

    I know this may sound slightly absurd, but please forgive my stupid question... <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Is there a "Before_Open" event - something that would occur before "Workbook_Open" ??
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Events in Excel (Win XP / O2003 UK SP2)

    Not that I know of. What are you trying to accomplish?
    Legare Coleman

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Events in Excel (Win XP / O2003 UK SP2)

    You couldn't store an event procedure for a "before open" event in the workbook itself, since the code would have to run before the workbook was opened...
    There is an application-level WorkbookOpen event, but it occurs AFTER the Workbook_Open event of the workbook itself.
    So I'm afraid the answer to your question is "no".

  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Events in Excel (Win XP / O2003 UK SP2)

    Not 100% sure, got the question from a colleague and was caught on the wrong leg - being unable to answer.
    So I just thought I'd try to consult the "Oracle(s)".

    Apparently: He wants to delete links, if any - before they start to update. (Sort of "If links - then delete")
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Events in Excel (Win XP / O2003 UK SP2)

    I can't think of a way to do that.
    Legare Coleman

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Events in Excel (Win XP / O2003 UK SP2)

    How about something like this (it would be in another file).

    <pre>Option Explicit
    Function OpenBreakLinks(sWbk as String)
    Dim vLinks As Variant
    Dim wOpen As Workbook
    Dim x As Integer
    Set wOpen = Workbooks.Open(Filename:=sWbk, UpdateLinks:=0)
    vLinks = wOpen.LinkSources(Type:=xlLinkTypeExcelLinks)

    If Not IsEmpty(vLinks) Then
    For x = LBound(vLinks) To UBound(vLinks)
    wOpen.BreakLink _
    Name:=vLinks(x), _
    Type:=xlLinkTypeExcelLinks
    Next
    End If
    End Function</pre>


    You can add it into your personal.xls workbook (see <post:=118,382>post 118,382</post:> ) and call it in a routine with the line like:

    Call OpenBreakLinks("C:PathFilename.xls")

    Steve

    Steve

Posting Permissions

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