Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Hiding A Text String?

Got some VBA code behind a button.

User clicks a "Save" button, VBA code pushes contents of a
worksheet into an MS Access DB.

The catch is that there are many users - each with their own .XLS
and there's a requirement that one user cannot peek at another
user's info. i.e. Open up the MS Access DB directly and browse
the table we're pushing data into.

I didn't want to get into the MS Access security model, so that
means that the MS Access DB is password protected.

Right now, the PW is in a Const string in the VBA, which feeds it
to a DAO.OpenDatabase via the Connect string.


Seems like a chicken-egg dilemma, but it would be nice if the
code behind that "Save" button could get to the PW, but somehow a
sophisticated user bent on snooping could not.

Only thing I can think of is somehow making it impossible for a
regular user of the .XLS to see VBA code, step through VBA code,
and/or get to an Immediate window.

Suggestions?
--
PeteCresswell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Hiding A Text String?

Put your code in a VB6 ActiveX dll.

RBS


"(PeteCresswell)" wrote in message
...
Got some VBA code behind a button.

User clicks a "Save" button, VBA code pushes contents of a
worksheet into an MS Access DB.

The catch is that there are many users - each with their own .XLS
and there's a requirement that one user cannot peek at another
user's info. i.e. Open up the MS Access DB directly and browse
the table we're pushing data into.

I didn't want to get into the MS Access security model, so that
means that the MS Access DB is password protected.

Right now, the PW is in a Const string in the VBA, which feeds it
to a DAO.OpenDatabase via the Connect string.


Seems like a chicken-egg dilemma, but it would be nice if the
code behind that "Save" button could get to the PW, but somehow a
sophisticated user bent on snooping could not.

Only thing I can think of is somehow making it impossible for a
regular user of the .XLS to see VBA code, step through VBA code,
and/or get to an Immediate window.

Suggestions?
--
PeteCresswell


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Hiding A Text String?

Hi Pete.

To hide your code and deny access to
the VBE, try:

In the VBE,

Tools | Properties | Protection |
Check 'Lock project for viewing | add a
password | Save and close the file

Note, however, that this protection is
largely illusory: it can readily be
circumvented by a knowledgeable user
or, indeed, by anyone able and willing
to Google.


---
Regards,
Norman


"(PeteCresswell)" wrote in message
...
Got some VBA code behind a button.

User clicks a "Save" button, VBA code pushes contents of a
worksheet into an MS Access DB.

The catch is that there are many users - each with their own .XLS
and there's a requirement that one user cannot peek at another
user's info. i.e. Open up the MS Access DB directly and browse
the table we're pushing data into.

I didn't want to get into the MS Access security model, so that
means that the MS Access DB is password protected.

Right now, the PW is in a Const string in the VBA, which feeds it
to a DAO.OpenDatabase via the Connect string.


Seems like a chicken-egg dilemma, but it would be nice if the
code behind that "Save" button could get to the PW, but somehow a
sophisticated user bent on snooping could not.

Only thing I can think of is somehow making it impossible for a
regular user of the .XLS to see VBA code, step through VBA code,
and/or get to an Immediate window.

Suggestions?
--
PeteCresswell


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Hiding A Text String?

On Jul 15, 6:51 pm, "RB Smissaert"
wrote:
Put your code in a VB6 ActiveX dll.


I don't have much experience with .DLLs - maybe I've created one or
two in the distant past - but it seems like the user could still open
up an Immediate window, find the code that calls the routine in
the .DLL, execute same in the Immdiate window, and see the result.

Have I got it right?

If so, it sounds like I'm fighting Mother Nature on this one....
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Hiding A Text String?

But the dll doesn't have to expose the password.
It could make the connection get the data and pass
it to Excel.

RBS

"PeteCresswell" wrote in message
...
On Jul 15, 6:51 pm, "RB Smissaert"
wrote:
Put your code in a VB6 ActiveX dll.


I don't have much experience with .DLLs - maybe I've created one or
two in the distant past - but it seems like the user could still open
up an Immediate window, find the code that calls the routine in
the .DLL, execute same in the Immdiate window, and see the result.

Have I got it right?

If so, it sounds like I'm fighting Mother Nature on this one....




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Hiding A Text String?

Per RB Smissaert:
But the dll doesn't have to expose the password.
It could make the connection get the data and pass
it to Excel.


Yesssssss!!!!!

Takes awhile to soak in sometimes....

Thanks.
--
PeteCresswell
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
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Hiding Column Also hiding text Cindy Excel Programming 0 April 6th 06 07:18 PM
Hiding SQL Connection String Hiran de Silva[_2_] Excel Programming 0 March 12th 06 04:18 PM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM
Hiding an SQL connection string in an Excel macro Bob Smith[_2_] Excel Programming 2 November 18th 04 09:37 AM


All times are GMT +1. The time now is 03:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"