LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default VBA References

You could set the Saved property to True in the BeforeClose event, that way
Excel doesn't complain.

Otherwise I think should do it:
If MsgBox("Save Changes?", vbYesNo) = vbYes Then ThisWorkbook.Save

Rob


"Tommy Y" wrote in message
...
Thanks Rob. Is there a way I can bring up the save
prompt (not the saveas dialog box) before I do this?
That way, I could have the user choose to save their
changes, but I would then set the displayalerts property
to false before I removed the reference.


-----Original Message-----
TT,

You could do something like:

With ThisWorkbook.VBProject
.References.Remove .References("MyVBAProject")
End With
MyVBAProject.ThisWorkbook.Close

Be sure not to save changes to your own workbook, else

the reference is gone
for good!

Rob


"Tommy T" wrote in

message
...
I have a workbook that references an add-in. I am

trying
to close the add-in when I close the workbook, but I
can't get it to work. I just get the message

that "This
workbook is currently referenced by another workbook

and
cannot be closed." I've tried putting the code in the
BeforeClose event, but since the workbook is

technically
not closed yet, it still doesn't work.

Any Suggestions?
TT



.





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert all 3d references to normal references in a workboo Dima Excel Discussion (Misc queries) 6 August 8th 08 12:38 PM
How to convert all 3d references to normal references in a workboo Dima Excel Worksheet Functions 6 August 8th 08 12:38 PM
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
How to rename references from range names to cell references Abbas Excel Discussion (Misc queries) 1 May 24th 06 06:18 PM


All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"