-
Kari Paukku
- PowerBuilder
- Friday, 16 October 2020 05:56 AM UTC
Hi,
We can open an excel fir ok using Ole and the following code (PB2019R2):
OleObject MyOle,wkb
MyOle = CREATE OleObject
MyOle.ConnectToNewObject('excel.application')
//Here we can add code that makes Excel not show up (MyOle.Application.Visible = false)
wkb = MyOle.Application.Workbooks.Open("c:\NoPassword.xlsx")
MessageBox("wkb.HasPassword",wkb.HasPassword)
and this will show False for the HasPassword variable.
When doing the same for a file that has a password, it works and shows Excel's "Enter Password" window.
But what we would like to do is to check if the file is password protected or not - that's all. The reason for this is that we don't want users to save spreadsheets with passwords to the database where we store documents.
Any help on this would be great.
Thanks,
ktp
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.