View Single Post
 
Old 08-21-2012, 06:54 AM
shabbaranks shabbaranks is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default

Changed the code to

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Dim wkbk1, wkbk2 As Workbook, wksheet1, wksheet2 As Worksheet, intIndex As Integer
'set the source workbook
    Set wkbk1 = Application.Workbooks("Trial1.xlsm")
'set the source worksheet
..................
And now it works when I shut Excel down
Reply With Quote