PC Review


Reply
Thread Tools Rate Thread

Automation in excel

 
 
=?Utf-8?B?U25PT3Bzcw==?=
Guest
Posts: n/a
 
      19th Sep 2007

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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation C++ code works for Excel 2003, not for Excel 2007 jayo Microsoft Excel Programming 0 6th Aug 2008 06:51 PM
How to determine if an excel Excel was open by code (automation) ormanually, by a human user Radu Microsoft Excel Programming 3 22nd Jul 2008 04:38 AM
Access automation leaves Excel open which in turn locks 2nd automation attempts EagleOne@discussions.microsoft.com Microsoft Access 8 30th Jun 2008 01:27 AM
automation on excel(automated from Access VBA code) stops when opening another excel file thread Microsoft Access 1 27th Apr 2007 09:07 PM
Excel Automation creates a hidden instance of Excel using the Append Method ScardyBob Microsoft Access VBA Modules 4 16th Aug 2006 02:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 PM.