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


Hello !
I work on VS 2005 and I use this sample to my application
http://support.microsoft.com/kb/q216686/ . I use automation to control excel
WITHOUT mfc and WITHOUT #import only pure api win32.
It's work perfectly but I have a big problem : The worksheet is protect in
excel

code VBA

Sheets(1).Protect Password:="XXXXXX", _
UserInterFaceOnly:=True


Someone know the params to invoke to unprotect the sheet or to execute a
macro by automation ?
I try this without chance.


bool MyExcel::SetProtect(bool b) {
VARIANT x;
x.vt = VT_I4;
x.lVal = b;
x.bstrVal=SysAllocString(L"XXXXXXXX");
//AutoWrap(DISPATCH_METHOD, NULL, pdispWorksheet, L"Protect", 0);
AutoWrap(DISPATCH_PROPERTYPUT, NULL, pdispWorksheet, L"Protect", 1, x);
return true;
}

I have the message, member unknow.

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
Supressing the ctrl-c and other keys during word automation in automation apondu Excel Programming 0 July 19th 07 10:10 PM
Excel automation Martin Walke[_2_] Excel Programming 6 March 28th 06 02:55 PM
Excel Automation using .NET Suman Excel Programming 1 April 7th 05 12:49 PM
C# Excel Automation Add-In Frank X Excel Programming 4 February 23rd 04 01:30 PM
Excel Com Automation Tom Ogilvy Excel Programming 5 November 10th 03 02:05 PM


All times are GMT +1. The time now is 11:37 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"