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: 4
Default Setting VBA passwords from within code

I have found that it doesn't seem to be easy to set a VBA password
easily from within code. I figure that I probably have to go down the
send keys route and so have set up the following sub

Sub SetVBAPassword()
Dim strPassword As String
strPassword = "monkey"

Excel.SendKeys "%TE^{TAB}VP", False
Excel.SendKeys strPassword & "{TAB}" & strPassword, False
Excel.SendKeys "{Enter}", False
End Sub

My problem is that this code will only work if it is in the same
project as the one you want to set the password for. I want to be able
to set the password from another workbook but don't know how to do it.
Can someone please help me.
 
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
setting excel formula from code Ralf Excel Discussion (Misc queries) 4 July 14th 09 10:31 PM
Code about setting Y Axes scale. fujing1003[_2_] Charts and Charting in Excel 3 December 11th 07 11:29 AM
change language setting using VBA code ub Excel Worksheet Functions 0 April 3rd 07 05:34 PM
setting tab order by code dlrauh Excel Programming 1 October 25th 03 08:38 PM
Setting Decimal in code David W[_3_] Excel Programming 0 August 22nd 03 05:16 PM


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