Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unlocking VBA project in Excel

Hello,

I have one password protected vba project in my excel file. I want to unlock
this vba project through C# code. Could anyone help me on this?

I tried the sendKey function of C# but still not able to get through. Here's
the code that I have used:

if(Workbook.VbProject.Protection==
Microsoft.Vbe.Interlop.vbext_ProjectProtection.vbe xt_pp_locked)
{
Workbook.Activate();
WorkBook.Application.OnKey("%{F11}",Type.Missing);
SendKeys.Send("%F11%TE" + Pwd + "~~");
}

Pwd is the variable containing the password to unlock the vbaproject.

Regards,
Ramo

Reply
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
Programatically Unlocking a Project in the VBIDE Jim Thomlinson[_5_] Excel Programming 2 January 5th 06 10:07 PM
Unlocking a Project Ralph Heidecke[_2_] Excel Programming 3 December 29th 05 04:39 PM
Locking and unlocking a Excel project for viewing VJ Excel Programming 3 April 7th 05 09:33 PM
Locking/Unlocking a VBA Project in 2000 vs '97 - Difference? RobNew Excel Programming 3 November 2nd 03 07:29 AM
unlocking a project in VB(A) Arne[_2_] Excel Programming 4 July 30th 03 09:29 AM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"