excel

XML Schema to be modified in excel (VSTO)

Hi, I am new to VSTO. I have mapped an excel document with XMl Schema.Now I need to create a functionality to change the xml schema in excel(On click a button it should show me the column of XML in tress view cntrol or in the list box) under which i should be able to delete some column and change the order of column . Any help will be...

excel columns selection query in C# winform

I am trying to match a date from a column in excel sheet whose column type is DateTime. using following query DateTime dtNew = Convert.ToDateTime("7/16/2010"); OleDbDataAdapter da = new OleDbDataAdapter("Select * FROM [" + SheetName + "$] where [Hand off date] = '" + dtNew + "'", conn); I am getting Datatype mismatch in criterion...

Excel 2007 - Find a word

I have like 3000 works in an excel cell that I need to search one word in. It does not highlight the word, it only places me into the cell with the word. Anybody has any idea how I can get the word highlighted that I am looking for? Thank you, Steve ...

Excel API Save As Dialog box issue

The Excel 2003 API has a GetSaveAsFilename method that pops up the Save As dialog. This takes in various parameters, including the file type (xls, txt, csv,...), something like the following: GetSaveAsFilename(Missing.Value, "Microsoft Office Excel Workbook (*.xls), *.xls", 1, Missi...

Excel 2003 VBA macro skips empty cells entirely, how to include those?

I've tried this but it doesn't work. it skips the rows that have A[i] empty. Any help is appreciated. Sub Consolidate() ''# Local Variables Dim cell, cell2 As Range Dim wks As Worksheet ''# Step 1: Clear master ''# Step 2 : Loop through the regional sheets Sheets("Master").Range("A2:Z65536").ClearContents For Each wks I...

How to NOT skip empty rows or cells in vba?

Is there any way to do a vba for each loop that loops a range but includes the empty cells/rows. PROBLEM: When I do a copy on the row from some other worksheet, the loop automatically skips the cells in the "A" column that are blank and skips that entire row completely and therefore I lose some data in that row because ONLY the A colum...

Excel 2003 send date parameters to SQL query

PROBLEM: I have a few worksheets that use sql queries to retrieve data. I would like all of these sheets to query data based on the same date range entered by a user in excel. eg. I would enter somewhere in a form or in a cell a date range and retrieve the value in sql to obtain data based on the user specified dates. Is there anyway t...

What is the difference between SUM and SUBTOTAL?

In Excel, what is the difference between SUBTOTAL (9, myrange) and SUM (myrange) ? ...

Design Advice - Upload Excel file and validate against web service

I think this is possible, but just wanted to get some feedback and/or information/links. Theoretically, I would like to have the ability to upload and Excel file to a web page (say ASP.NET) and have this collection of data validated against an existing web service I have in place . This web service is used to CRUD operations into the D...

How do I prevent values being shown as # in excel

I have a cell which is formatted as Text field with wrap text on. The values are shown as "#" when I move away from the cell, how do I prevent it? ...

How should I format my cell to have a bulleted list of items

How should I format my cell to have a bulleted list of items. Currently I create the bulleted text in word and paste it in the excel cell, but when I try to add a new item using the enter button it takes me to the next cell but doesn't add a new bullet item. How should I do this? ...

How to create a running index on a field containing text and numbers

We have a column with values like this (USER.F1, USER.F2. USER.F3 ...) for regular integer columns we usually do something like =A1+1 for cell A2 so that it increments appropriately. Will I be able to do something similar for the above column values. ...

Working with cells

I got the following simple functions: Public Function AddFields(field1 As Range, field2 As Range) As String AddFields = "=" + field1.Address + "+" + field2.Address End Function Private Function GetCustomerCount(monthNumber As Integer) As Range If monthNumber < 6 Then GetCustomerCount = Range("D13") ElseIf monthNumb...

Getting Excel Data Into Access

Hi I have to get the data in an Excel sheet into a Access database. The datastructures of the Excel sheet and the Access database are very different, so a lot of reformatting/restructuring has to be done. So I like to use VBA to import the data. I know that I can open the sheet in an Excel instance from VBA, then reading, converting and...

Setting validation via VBA in excel fails when using variable

I am trying to set the data validation for a range of cells using VBA. I get a run-time error 1004 (so helpful) "Application defined or object defined error" with this code. With rngRangeToCheck.Cells(lrownum, 1).Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Form...

Check to see if element of one list exists in another list.

I have a list of header values from an excel spreadsheet that is set up to look like a flat table. I also have a list defining the key fields of the table that the excel sheet will be inserted to. I basically want to iterate through the list of header fields, and the header exists in the list of key fields, add it to a map of some sort. ...

Differences between Excel and SQL sorting

Programs used: SQL Server 2000, Excel 2003 We have a table in our database called Samples. Using the following query... SELECT [Sample], [Flag] FROM Samples ORDER BY [Sample] ... we get the following results: Sample Flag ---------- ---- 12-ABC-345 1 123-45-AB 0 679-ADC-12 1 When the user has the same da...

How to highlight specific row in Excel if column value is one of a list of value in another sheet

I have a column in one sheet that I want the value of it to determine the color of the row (background color). So if the value exist in another sheet's set of value it will color it green otherwise red. ...

Problem while reading excel file in C# with ADO.Net

Hello everyone, I just started C# today, and i have trouble reading an excel file. Here's what i did : OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filePath + @";Extended Properties=""Excel 12.0;HDR=YES;"""); OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet$]", conn...

How to rename an Excel worksheet using OLEDB, ODBC or something else, other than an instance of Excel?

I am needing to rename an Excel worksheet that comes to us via FTP. The server the sheet resides on does not have Excel running on it so trying to script it via WSH and vbscript using Excel.Application is out of the question. Is it possible to rename an Excel worksheet via OLE DB, ODBC or some other mechanism? ...