remove reference via code

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Hello

I'm trying to work out how to remove a reference (to Microsoft Outlook
9.0 Object Library) automatically from code when the spreadsheet is
opened. I've found application.VBE.VBProjects(1).References from just
rooting around but can't work out (or find any documentation on) how
to actually remove a reference.

Is this possible? Am i barking up the wrong tree? Please help

Thanks in advance
 
Brian,

You need to pass the Remove procedure a valid reference Object:

ThisWorkbook.VBProject.References.Remove _
ThisWorkbook.VBProject.References.Item("Outlook")

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top