View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 7
Default activate PublicConst

I have a workbook AA.xls that contains an Auto_Open sub
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents("Public")
ThisWorkbook.VBProject.VBComponents.Remove VBComp
Dim FName As String
FName = "c:\mam97\code.txt"
ThisWorkbook.VBProject.VBComponents.Import FName
End Sub

The content of the txt file is:

Attribute VB_Name = "Publique"
Public Const Drive = "c:"

When the auto_open execute it does not activate my Public Const "DRIVE" and
assign it the value of C: !!

Any clues????

Regards Michel