PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 23 → WD: Protect an Excel file with Passord
WD: Protect an Excel file with Passord
Débuté par Gianni Spano, 21 oct. 2010 19:43 - 6 réponses
Posté le 21 octobre 2010 - 19:43
Hello
I have over 120 excel files to protect with the same password.
These files are created with WD, reading each record (one for every excel file)
from a customer file and because the context of each file is private, i need to secure these files with a password. Every time a user try to open a file, it must prompt to input a known password.
Does someone have a solution to set a password during the step
when i generate the excel file?
Below there is a little solution i have found in Visual Basic:
Sub ProtectFile()
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For i = 1 To nombre
Worksheets(i).Protect , password:="blabla"
Next i
End Sub
Sub UnProtetFile()
' unprotect all sheets
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For i = 1 To nombre
Worksheets(i).Unprotect , password:="blabla"
Next i

TIA
Gianni
Posté le 22 octobre 2010 - 01:58
I didn't test it but this code and your explanation don't seems to match.
NOTE: the code that I am suggesting is untested. I don't have access to WinDev, i'm at home (today at least i leave the office at a decent hour).
to translate this code to Wlanguage use something like this:
m_xExcel is object OLE dynamic
m_xExcel=new object OLE "Excel.Application"
m_xExcel>>Workbooks>>Open("c:\myfiles\test.xls")
wint is int
wi is int
wint = m_xExcel>>ActiveWorkbook>>Sheets>>Count
FOR wi = 1 TO wint
m_xExcel>>Sheets( wi)>>Protect("aaa")
END
m_xExcel>>ActiveWorkbook>>Saveas("c:\myfiles\test_1.xls")
m_xExcel>>ActiveWorkbook>>close(False)
m_xExcel>>Quit()
delete m_xExcel
to do what you are asking use something like this:
m_xExcel is object OLE dynamic
m_xExcel=new object OLE "Excel.Application"
m_xExcel>>Workbooks>>Open("c:\myfiles\test.xls")
m_xExcel>>ActiveWorkbook>>Saveas("c:\myfiles\test_1.xls",*,"aaa")
m_xExcel>>ActiveWorkbook>>close(False)
m_xExcel>>Quit()
delete m_xExcel
Posté le 22 octobre 2010 - 09:28
Thanks Paulo
I will try your solution tomorrow morning..
Thanks again for your support..
:spos:
Gianni
Posté le 30 août 2018 - 13:38
Hi,
Friend you can also try ZetExcel

Jeremy Gore
Posté le 04 septembre 2018 - 13:48
If you are getting frustrated because of losing the password of Excel file so in this case just make use of the foremost eSoftTools Excel File Password Recovery Software that scrutinize all Excel file and take out the original password. You will get password by taking help of two unique methods like- dictionary attacks and brute force attacks. Both methods are easy to operate and capable to recover password and also takes small period of time for recovery password from Excel, word and Access file.
Read More:-http://www.esofttools.com/excel-password-recovery.html
Membre enregistré
1 message
Posté le 15 septembre 2018 - 10:49
SysInspire Excel Password Unlocker Software is enhanced & successive application which efficiently works to find out the lost and forgotten Excel file password and Unlock Excel file program. By taking help of this Excel Password Remover Software users can remove protection from Excel file, Word documents and access file password. Excel Unlocker Excel Unlocker Software offers very easy to handle unique method such as- dictionary attacks, brute force attacks and password known attacks for recovery password of Excel file related to alphabetic, numerical, symbolic password from excel file. Excel Password Recovery Software supports all excel file versions included- 2016 and 2013, 2010 Password, 2007, 2003, 2002(XP), 2000 and Excel 97.

Read More:-https://www.sysinspire.com/excel-password-recovery/
Posté le 22 septembre 2018 - 12:21
Excel File Password Recovery Software which is suitable program to recover forgotten MS Excel Password and unlock protection of Excel file password. Using of PDS Excel Password Recovery Software all users can recover all kind of password alphabetic, numerical, special-characters and symbolic of Excel worksheet password and also preview of all recovery process at free of cost. This Software works on whole MS Excel file versions including: 2016, 2013, 2010, 2007, 2003, 2002(XP), 2000 and Excel 97 & Windows Versions up to win 10 (32 & 64 bit).

Click Here: http://www.perfectdatasolutions.com/excel-password-recovery-software.html