Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Password exposure

Hello all,

I have a macro that does various things and then saves
the new spreadsheet under a new name.

The code is as follows:

Sheets("MON AFT").Select
thisFilename = "C:\headoffice\"
thisFilename = thisFilename & CStr(Range("BW3"))
thisFilename = thisFilename & "_04_abcsheet"
ActiveWorkbook.SaveAs thisFilename

The users are not the most diligent and may access the
original file and run the macro again. When it comes to
save it tells them that the file already exists, do they
want to overwrite? It's possible they will say no.

If they do i get an error and the programming is exposed
which contains details of the passwords. Is there a way
of stopping this happening?

Cheers

Joe

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Password exposure

Joe,

Try this

Sheets("MON AFT").Select
thisFilename = "C:\headoffice\"
thisFilename = thisFilename & CStr(Range("BW3"))
thisFilename = thisFilename & "_04_abcsheet"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=thisFileName
Application.DisplayAlerts = True

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Joe Bannister" wrote in message
...
Hello all,

I have a macro that does various things and then saves
the new spreadsheet under a new name.

The code is as follows:

Sheets("MON AFT").Select
thisFilename = "C:\headoffice\"
thisFilename = thisFilename & CStr(Range("BW3"))
thisFilename = thisFilename & "_04_abcsheet"
ActiveWorkbook.SaveAs thisFilename

The users are not the most diligent and may access the
original file and run the macro again. When it comes to
save it tells them that the file already exists, do they
want to overwrite? It's possible they will say no.

If they do i get an error and the programming is exposed
which contains details of the passwords. Is there a way
of stopping this happening?

Cheers

Joe



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Password exposure

If your code contains passwords I would also protect the VBA project a
follows;

In the VBA Editor select the workbook in the Project Explorer pane an
then select Tools/VBAProject properties ( this assumes you have no
renamed the project ).

On the Protection tab, check the Lock Project for Viewing checkbox an
enter and confirm a password ( don't forget this as without it yo
won't be able to edit your code ).

Now you won't be able to view the code without entering this password

--
Message posted from http://www.ExcelForum.com

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
How to retrive password protected worksheet but forgot password? Laurie Excel Worksheet Functions 1 November 19th 09 09:42 PM
cell object exposure outside of VBA Thomas Homan Excel Worksheet Functions 3 August 7th 06 09:23 PM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM
VBa, Password protected sheet fails to get unprotected with the same password Hans Rattink Excel Programming 3 July 28th 03 02:30 PM


All times are GMT +1. The time now is 01:55 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"