excel

Macro input Value and extract rows accordingly

This is an excel sheet with 4000 rows * 200 columns. one column has 10 different names in the column. Function of my macro is to first ask for the name of person whose report is required. Suppose I say "Ram" it will extract all the rows equal to that name and save the values in new workbook and save the file name as "Ram" ...

Hide n protect formula

When I circulate my statistical worksheet to users outside my company, I need to protect the underlying confidential formulas but also keep the worksheet easy for users to enter their data. Any ideas? ...

Read/write Excel 2007 password-protected documents

What method does Office 2007 use for encryption (when choosing Encrypt and setting a password from Office menu)? My C# app needs to create and read encrypted Excel 2007 files (.xlsx). It is important that these files remain accessible from Excel, so I must use Microsoft's encryption method, can't brew my own. Normal Excel 2007 file is ...

Why can I not delete this pesky Drop Down from a Sheet in Excel?

I am trying to delete a drop down from a spreadsheet using the following code: Dim objShape As Shape For Each objShape In ActiveSheet.Shapes objShape.Delete Next But objShape returns Application-Defined or Object-Defined Error: Debug.Print objShape.FormControlType returns xlDropDown Debug.Print objShape.Name                      ...

Excel formula to find the first non-alpha character in a cell?

Is there a way using a cell formula in Excel to find the index of the first non-alpha character in a referenced cell? I've imported data into Excel which has a column that looks like this: <some text I don't want in the derived cell><some text that prepends the text I want and is always constant>TheTextIWant<Some non-alpha character><s...

How to get COM Server for Excel written in VB.NET installed and registered in Automation Servers list?

Versions Excel 2007, Windows Vista, VB.NET, Visual Studio 2008 with .NET 3.5 sp2, MSI setup package. What I am trying to do I have an Excel UDF that is written in VB.NET. It is exposed as a COM Server because you cannot create Excel UDFs in .NET languages directly. Installation is a real pain because none of the installation settings ...

Excel - changing embeeded DSN

Hello, I have an Excel with an embeeded DSN. When I open the Excel in Notepad i see it: DSN=serverName;Description=serverName;UID=UserName;;APP=Microsoft Office 2003;WSID=LT-533571;DATABASE=DatabaseName I want to change the server property, how can I do it? It's driving me nuts, tried editing the excel in Notepad - crashes the Excel, ...

Excel OLE - .NET COM AddIn behaves differently when Excel is embedded in an application

I have a .NET (C#) addin that uses a COM Shim dll to load itself into Excel. The addin works fine without any problem when Excel is run normally. The addin displays its own custom toolbar in Excel that is used to execute different commands. When I embed Excel into another application (e.g. DSOFramer etc), the addin starts behaving stran...

read/write excel file in java

i just want to read and write a excel file from java.No complex calcutionns needed I just want to creat a excel sheet with 3 col and n rows. Like printing one string in each cell. Can anyone giv me simple code snippet ofr this? Do i need to use any external lib or do java have build in support for it? i want to do following for(i=0 ;i...

open Excel workbook in C#

I'm facing a strange issue when trying to open an excel sheet through a C# application. it uses something like the following while the templatePath is "C:\template.xls" for example. Workbook excel_workbook = this.excel.Workbooks.Open(templatePath, mMissingValue, false, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissing...

Jet Engine - 255 character truncation

Hi, I'm needing to import an Excel spreadsheet into my program and have the following code: string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;IMEX=1;HDR=NO;""", MyExcelFile.xls); command.CommandText = "SELECT * FROM [Sheet1$]"; (Note, code above isn't real cod...

How can I display an operating-system environment variable from within Excel?

I have an application written in Excel plus a bunch of C++ / Python addins. The location of the various config files used by the addins is determined at startup time by a number of environment variables. I'd like to debug a problem related to these environment variables by the most direct possible means: Can I simply type in an Excel f...

What is the correct way to dynamically set environment variables before running Excel?

I have a bunch of Excel addins which are configured by an environment variable. Normally these are set in the registry on a system-wide basis. When I want change the value non-dynamically I go to: my-computer -> properties -> advanced -> environment variables -> System variables I have verified that when I set an environment variable ...

Export XML to Excel spreadsheet using Javascript/classic-ASP

I'm trying to export XML data from a web page to a spreadsheet using javascript. So far I've just tried the very simple: Sub Export Response.ContentType = "application/vnd.ms-excel" <script> var XML = document.getElementById("xmldata"); window.open(XML); </script> End Sub This t...

Read Excel data from Drop down into C# object array

Hi all! From within C# I'm trying to read data from an Excel sheet into an C# object. Everything works fine except one small detail, Excel data from drop down lists. Somehow the result in the array is null for every corresponding Excel drop down list entry. My code so far below: var range = sheet.get_Range("A1", "D3"); var value...

Excel change chart formula

I'm currently generating Excel-documents using the Office Object Model. I have a problem with editing charts. In a template file I got a bar-chart which uses the following source: 2008 2009 2010 A 10% 25% 15% B 20% 25% 35% C 30% 25% 45% D 40% 25% 5% The chart has the following formula: =she...

importing excel data into access

My VB.NET application is using importing some excel sheet into access command.CommandText = "SELECT * INTO [MS Access;Database=" & current_db & "].[" & sheet_name & "] FROM [" & sheet_name & "$]" The problem is that if I have some cells with the green error message in excel they are not imported in access. And they are actually in the...

Excel sheet with XSLT transformation ... need protection

Hello, I need to export DataSet result to Excel file (using dataset, XSLT transformation and XML generation => XML spreadsheet). That's work, but I'd like to protect this sheet. The reader can only make change in some dropdown, in some cell but other change are not allowed. The only changes allowed are some specific cells (value or drop...

C#: How can I open and close an Excel workbook?

Does anyone know how to simply open and close an Excel workbook? I don't need to read any data from the file, I just need to open and close it. (*) I'm guessing that I'll need to reference the Microsoft.Office.Interop.Excel assembly. *Reason: I've already configured pivot table information with a 3rd party library (Aspose). Now I ne...

VB.NET COM Server implementing Excel UDF not callable with optional Excel.Range

Versions Excel 2007 (12.0.6425.1000) SP2, Visual Studio 2008 with VB.NET, Windows Vista The windup I have an Excel UDF written in VB.NET that has this signature: Public Function NonExcelName(ByVal A As Integer, _ ByRef B As Range, ByRef C As Range, _ Optional ByVal D As Integer = 1, _ ...