Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Michel,
"Drive" is a VBA keyword and trying to redefine it into a constant may be causing the problem. Try MyDrive. -- John johnf202 at hotmail dot com "MD" wrote in message .. . 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
activate macro | Excel Discussion (Misc queries) | |||
Can't activate an add-ins | Setting up and Configuration of Excel | |||
When to Activate? | Excel Discussion (Misc queries) | |||
ACTIVATE CELLS | Excel Worksheet Functions | |||
De-activate a chart | Excel Discussion (Misc queries) |