View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Turn on reference within a macro

On May 16, 12:14*pm, wrote:
Hello,

I was wondering if it was possible to run a macro that would turn on a
reference? *Specifically, the Adobe Distiller reference (VBa editor -
Tools - References). *I would like for my spreadsheet template to
have it turned off by default, but if a user wants to run a macro that
calls the distiller then the reference would turn on.

Is this possible?

Thanks in advance for any responses.


Give something like this a shot, changing the Item to whatever your
reference is.

Sub Remove_Reference()
Dim x As Object
Set x = Application.VBE.ActiveVBProject _
.References.Item("R8ole32.tlb")
Application.VBE.ActiveVBProject.References.Remove x
End Sub