Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Supressing the ctrl-c and other keys during word automation in automation | Excel Programming | |||
Excel automation | Excel Programming | |||
Excel Automation using .NET | Excel Programming | |||
C# Excel Automation Add-In | Excel Programming | |||
Excel Com Automation | Excel Programming |