Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Global Const for password
Hello, I have a Global Const PWORD = "pwrd" declared in a wb module of Excel. Then I have written a macro to Unprotect and another to re-Protect all the wb sheets. Now I'ld like to create a macro to change the password periodically. My question is: is it possible to re-declare PWORD programmatically without using a file to store its value? Or, in other words, how you'ld do? Emiliano -- eggpap Excel 2003 on Vista HP System - can use VBA ------------------------------------------------------------------------ eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52031 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Global Const for password
Something like this?
Sub ChangePassword() Dim Line As String Dim i As Long With Application.VBE.ActiveVBProject.VBComponents("Modu le1").CodeModule For i = 1 To .CountOfLines Line = .Lines(i, 1) If Left$(Line, 16) = "Global Const PWD" Then .ReplaceLine i, "Global Const PWD As String = ""new_pwd""" End If Next i End With End Sub -- __________________________________ HTH Bob "eggpap" wrote in message ... Hello, I have a Global Const PWORD = "pwrd" declared in a wb module of Excel. Then I have written a macro to Unprotect and another to re-Protect all the wb sheets. Now I'ld like to create a macro to change the password periodically. My question is: is it possible to re-declare PWORD programmatically without using a file to store its value? Or, in other words, how you'ld do? Emiliano -- eggpap Excel 2003 on Vista HP System - can use VBA ------------------------------------------------------------------------ eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52031 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Global Const for password
Many Thanks, I will try! -- eggpap Excel 2003 on Vista HP System - can use VBA ------------------------------------------------------------------------ eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52031 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Const and VBA values | Excel Programming | |||
Const Array | Excel Programming | |||
Global Password Change | Excel Programming | |||
Not recognizing a Const | Excel Programming | |||
crash changing const to public const | Excel Programming |