LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reading a VBA constant value by an outsider macro?

If the project is not locked, look at

http://www.cpearson.com/excel/vbe.htm

for how to use code to work with code (you should be able to read your
constant by reading the lines of code in the code module).

However, if you don't lock you code, then anyone can go into your code
module and read the constant.

Maybe you could create a custom document property that holds an
encoded/scrambled version of the password and provide the code to
unencode/unscramble it.

http://www.cpearson.com/excel/docprop.htm


http://support.microsoft.com/default...b;en-us;224351
Dsofile.exe Lets You Edit Office Document Properties from Visual Basic and
ASP

--
Regards,
Tom Ogilvy



Rob wrote in message
m...
Hello FellowNewsgroupReaders,

I think I know quite a lot of protecting my projects and spreadheets.
I create a workbook called "A.XLS".
VBA code stores a password to open another sheet.
In VBA I declare a constant, like
const constPass = "123"
I protect the VBA code with a password.

If I open "A.xls" and create another sheet "B.xls", is it possible to
create code to read the constant from the VBA in "A.xls"?

I suspect it is NOT possible. I just want to know IF it possible in any

way.
If so, I cannot store my password in a constant and I need to find another
solution. But the solution above will help me make things easier.

Am I right with this?

Regards,
Rob Zoomer




 
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
VBA macro for reading text file into Excel Javed Khan Excel Discussion (Misc queries) 0 October 14th 09 06:29 PM
Reading Word document by using Excel Macro Arvind Mane Excel Discussion (Misc queries) 2 September 26th 08 07:55 AM
Please Help for a macro reading files not in sequence Francesco Excel Discussion (Misc queries) 8 April 15th 06 06:13 PM
auto reading macro Rich Excel Discussion (Misc queries) 3 February 7th 06 03:36 AM
Reading a VBA constant value by an outsider macro? Chip Pearson Excel Programming 1 September 7th 03 12:13 PM


All times are GMT +1. The time now is 08:54 AM.

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"