Article ID: 176251
Article Last Modified on 9/22/2005
151261 OFF97: How to Obtain and Install MS Office 97 SR-2
Public WithEvents App As Application
Private Sub App_WorkbookBeforeClose(ByVal Wb As Excel.Workbook, _
Cancel As Boolean)
MsgBox "App_WorkbookBeforeClose"
End Sub
Dim X As New Class1
Private Sub Workbook_Open()
Set X.App = Application
End Sub
Sub Test_BeforeClose()
Dim xFormula As String, i As Integer, j As Integer
Windows("Worksheet in BeforeCloseTest.Doc").Activate
i = Workbooks("Worksheet in BeforeCloseTest.Doc 2") _
.Worksheets("Sheet1").Range("A100").End(xlUp).Row + 1
Range("A1").Name = "RefCopy" & I
Range("A1").Copy
Windows("Worksheet in BeforeCloseTest.Doc 2").Activate
Range("A" & i).Select
ActiveSheet.Paste Link:=True
xFormula = ActiveCell.Formula
For j = Len(xFormula) To 1 Step -1
If Mid(xFormula, j, 1) = "!" Then Exit For
Next j
ActiveCell.Formula = Left(xFormula, j) & "RefCopy" & i & "'"
End Sub
Additional query words: XL97
Keywords: kbbug kbqfe kbprogramming kbhotfixserver KB176251