Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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



  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default activate PublicConst

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
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
activate macro Jase Excel Discussion (Misc queries) 1 June 9th 08 08:25 PM
Can't activate an add-ins Ivan Setting up and Configuration of Excel 0 June 5th 08 09:33 AM
When to Activate? Antonio Excel Discussion (Misc queries) 5 June 8th 06 12:26 AM
ACTIVATE CELLS mdeanda Excel Worksheet Functions 2 May 29th 05 10:32 PM
De-activate a chart daniel chen Excel Discussion (Misc queries) 6 April 24th 05 05:01 AM


All times are GMT +1. The time now is 09:45 PM.

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"