PDA

View Full Version : Issue with deleting adding



Djblois
01-07-2009, 11:08 AM
I have a module in my addin that makes it easier for my users to update the addin because it removes the toolbar and deletes the addin from the addin folder. Here is the code that I use:

Set obj = CommandBars("Business_Reporting_Today")
'Save Toolbar Position for future install
If Err.Number = 0 Then
SaveSetting "BRT", "Toolbar", "Top", obj.Top
SaveSetting "BRT", "Toolbar", "Left", obj.Left
SaveSetting "BRT", "Toolbar", "RowIndex", obj.RowIndex
End If
obj.Delete 'Delete Toolbar
With Workbooks("Business Reporting Today.xlam")
.Saved = True
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With


However some of my users it is crashing on these lines:

.ChangeFileAccess xlReadOnly
Kill .FullName

I was going to copy the message but it just suddenly stopped giving me this issue. Nothing changed but the issue is gone. Anybody have any ideas?

Bob Phillips
01-07-2009, 11:58 AM
Are you sure it isn't already gone in these instances?

Djblois
01-07-2009, 12:03 PM
Yes because I have stepped through it, and that code is actually in the addin so it would close that out when complete.