Microsoft
Software
Hardware
Network
Question : Translate from Excel VBA to Perl the method "ProtectForSharing"
Hey guys!
I have an excel file un-protected "Un-Protected and un-shared workbook"
What I need to do is protect it ("Protected and shared workbook") during execution time. I am using Win32::OLE.
I am able to unprotect "Protected and shared workbook". But I can't protect it.
To be more clear:
I need to translate from Excel VB code to Perl the method "ProtectForSharing"
Workbooks(1).ProtectForSha
ring Password:="drowssap", _
SharingPassword:="gnirahs"
Here is the code:
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3;
$| = 1;
my $Excel = Win32::OLE->GetActiveObjec
t('Excel.A
pplication
')
|| Win32::OLE->new('Excel.App
lication',
'Quit');
$Excel->{Visible} = 1;
my $Book = $Excel->Workbooks->Open("f
ile.xls");
my $Sheet = $Book->Worksheets(2);
$Book->UnprotectSharing("p
assword");
# It works very good
# The next expression doesn't work:
$Book->ProtectForSharing({
SharingPas
sword => "password"});
$Book->Save;
$Book->Close;
Thanks !
Answer : Translate from Excel VBA to Perl the method "ProtectForSharing"
For the above, a messagebox will popup for which u have to say "Yes" always.
Random Solutions
Unable to send e-mail invitations in Microsoft Office Live Meeting
Restore points don't work in Vista or XP
Installing authentic windows xp (pro or home) over possible unlicensed xp version.
options for repairing unstable laptop - low level re-format?
A public folder will display in Outlook, but not Webmail
Can't boot XP: recycles, Safe mode fails
What is the best way to reorganize XP's "Start, All Programs" list?
exchange MTA, all sent mail is NDR'd
Citrix Client in locked PCs
Office 2003 - Font size is too small when opening emails with Outlook 2003