Показать сообщение отдельно
Старый 22.07.2005, 09:46   #17  
Ace of Database is offline
Ace of Database
Участник
Аватар для Ace of Database
 
870 / 637 (23) +++++++
Регистрация: 14.10.2004
Вставьте в класс ComExcelDocument_RU следующий метод и вызывайте его. Этот метод защищает все листы документа от всего, в том числе и от копирования.
PHP код:
void DD_Protect()
{
    
com     appactiveSheetactiveWindowsheets;
    
int     ishCount;
    ;
    
app this.getApplication();
    
sheets app.sheets();
    
shCount sheets.count();
    for (
1<= shCounti++)
    {
        
activeSheet sheets.Item(i);
        
activeSheet.protect(
            
"gh1h5kl9o07df53",  //password
            
true,               //DrawingObjects
            
true,               //Contents
            
true,               //Scenarios
            
true,               //UserInterfaceOnly
            
true,               //AllowFormattingCells
            
true,               //AllowFormattingColumns
            
true,               //AllowFormattingRows
            
true,               //AllowInsertingColumns
            
true,               //AllowInsertingRows
            
true,               //AllowInsertingHyperlinks
            
true,               //AllowDeletingColumns
            
true,               //AllowDeletingRows
            
true,               //AllowSorting
            
true,               //AllowFiltering
            
true                //AllowUsingPivotTables
            
);

        
activeSheet.enableSelection(-4142);  //xlNoSelection
    
}
    
activeWindow app.activeWindow();
    
activeWindow.displayGridLines(false);

За это сообщение автора поблагодарили: kashperuk (5), Logger (3).