Visual Studio Development Bookmark and Share   
 index > Visual Studio Tools for Office > How to hide, restrict, or stop copying of Excel Formulas by using Microsoft.Office.Interop.Excel
 

How to hide, restrict, or stop copying of Excel Formulas by using Microsoft.Office.Interop.Excel

Hi

I'm loading db records and generating the excel, ones excel is downloaded/generated, some of the fields which are allowable for editing can key in and does some calculations, now I can hide the formula by keeping in some cells by hiding/ locking the sheet, but it does not work when I try to copy excel data and paste it is fresh sheet, every thing is visible and unprotected.

Please some one help me, how to restrict further for not allowing or copying the records and viewing the formulas used in the sheet.

I'm using Microsoft.Office.Interop.Excel for developing the application.

Kishore.inline  Thursday, October 15, 2009 12:20 PM
Questions concerning "Interop.Excel" rather than the VSTO technology are better asked in a venue that specializes in Excel. You'll find some links in the VSTO forum's Please Read First message.

FWIW I think that you should perhaps paste only the values to the new sheet? I believe that can be done using the PasteSpecial method? If you don't want to apply protection to the sheet after pasting, I think that is going to be the only possibility.
Cindy Meister, VSTO/Word MVP
Cindy Meister  Thursday, October 15, 2009 4:07 PM
Yes, I'm using VSTO Technology.


It should copy only values, which are visible not from the hidden columns of the excel and should not crack the password protected.



Kishore.inline  Friday, October 16, 2009 4:34 AM
You're using VSTO, but the application you're working with is Excel. VSTO does not change or extend this aspect of the Excel application, which is why this kind of question is generally better asked in a venue that specializes in Excel.

Again, I urge you to look at the PasteSpecial method. First test it in the UI to see if it basically does what you require (pastes only the values). You can then record a macro in Excel so that you can determine the basic syntax (parameter values) required and from there incorporate it into your code.
Cindy Meister, VSTO/Word MVP
Cindy Meister  Friday, October 16, 2009 6:25 AM

You can use google to search for other answers

Custom Search

More Threads

• VSTO migrating from 2003 to 2007: Microsoft.Vbe.Interop.VBProject.VBComponents.Add fails silently. Why?
• How to access an email Internet Header?
• DeploymentException when Debug Outlook addin
• Bug in Microsoft Word IncludePicture Fields
• Application Generated Tasks & Notifications
• updating some of the charts in a presentation (powerpoint 2007)
• CharNum
• How to create document w/o assembly attached?
• ActionsPane and IDTExtensibility2
• VSTO Visual Studio 2005 Problem