excel

when importing data from excel to vb.net file open problem

When importing data from excel to vb.net desktop application, Im having "file is open" error. Excel file is at the remote pc. Excel file must open and I have to reach anytime. How can I handle this problem? ...

What is the correct way to import and export out of Excel to SQL Server and back?

Looking for the correct way and control to import and export of out of Microsoft Excel programmatically. I am willing to get a 3rd party control that supports this functionality, or I can create it myself, but looking to get this prioject done fast. The Datasource will be offline. Although when it is online for the upload/download if ...

How add Multiple selection Listbox to a cell in Excel

How do I add a Multiple selection list to an Excel spredsheet in each cell of one column. I need to be able to read the selected values in c#. Looking for a managed code solution. CANNOT USE INTEROP Anything that allows a multiple selection and the aability to read using OLEDB, currently using a listbox. WE can only use ADO.NET & C# ...

How do you add a forms controls to a cell in a Excel spreadsheet for each row.

How do i add a forms control in excel to a cell, I know I can draw it, but I need to make it a member of each row and it's values attached to that cell/row. ...

How to save Excel date time cell into MySQL using VBA?

The mysql table has a DATETIME field. I want to INSERT a new row into this field using the cell data from the Excel worksheet. But I cannot use the datetime formatted cell value in a INSERT INTO query. How can I implement this? ...

Run VBA macro when condition is met

Hello all, I'm creating a spreadsheet to train my numerical skills. Now, I use VBA macros to generate a new problem once the current one has been correctly solved. To do so, I still have to press a button in the worksheet, which costs time and is annoying. Is there a way that I can execute a macro when a certain condition is met? f...

OWC11 Date Formatting Ignored

I am creating an Excel document using owc11. I am providing the dates in dd/mm/yyyy format. I am doing something like this in the code: for (..looping through results..) { Range c = EmailStats.putCellValue(sheet, row, 1, val); c.set_NumberFormat("dd/mm/yyyy"); } private static Range putCellValue(Worksheet sheet, int row, int co...

How do I convert an XLS document to XML in C#?

Hi all. I have an Excel spreadsheet that looks like: I'd like to convert this to some XML that looks like: <UserName> bla1 </UserName> <Mail> bla1[at]bla2.com </Mail> <Address> World </Address> can anyone help me do this in C#? ...

Convert to date

Hi! How i can convert number 20020415 to date 15.04.2002. I am working in Microsoft Excel 2003? Thanks! ...

Sorting values in Excel issue

I have a spreadsheet that I am sorting based on an "item number" column. So if the item number column has the following values: 2.2 2.1.b I want the row with the 2.1.b to be before the 2.2 row. However, the sort function in Excel puts 2.2 ahead. It must determine value based on the # of characters. Is there a way to do sort the co...

need to replace an image inside word-document with an excel chart

is there any simple way to replace an image inside word-document with an excel chart using VB and preserving all of the format details such as image frame style, text wrap, anchor, etc. (thus the image is just a placeholder in a template document) ...

FileSystemWatcher.Changed fires immediately when Excel 2007 opens XLS file in compatibility mode

We use a FileSystemWatcher to monitor documents opened from our Document Management system, and if the user saves the document, we ask if they would also like them updated in our system. We have a problem with XLS files in Excel 2007 (have not verified that the problem does not exist in 2003, but it only seems to be files that open in c...

How to define a key-value pair to use for a combo-box on an excel sheet?

On a spreadsheet, based upon the content in column A, the correct range must be selected from the content in B. A = 1 h, 2 h, 3 h, 4 h ... 23h, 1d ... 1 w, ... 1m, ...1 y, 2 y ... 15 y B = 0-2yr, 2-5yrs,5-10yrs,10-15yrs,>15yrs At present, the data in both columns is entered manually. I'm in the middle of defining both as a list to mak...

SQL UNION ALL problem with adjacent columns

I'm getting a formatting problem when I use UNION ALL under Excel 2007. I have 12 worksheets one for each month I'm trying to apply UNION ALL to combine all the data from these 12 worksheets. Each worksheet has 3 columns 2 with numerical data and one with date. I've had the problem with the last worksheet. My numeric column turns into st...

Starting Off VBA Macro With C# - Password Grief

I am stuck - I have a macro in a workbook which I can call quite easily using the run method on MSDN The problem is that if the workbook has a password protecting the code then this becomes much more difficult and forces a dialog box to appear.. Does anyone know how to run a macro from C# which has a password on it?? ...

ASP.NET Excel Export formatting question

Hey Guys, I've been banging my head on the wall over this issue for a couple days now and I need some help. I'm creating an excel file using ASP.net and everything is going just fine except one column has to be formatted as a decimal to 2 places but when it pulls into excel, excel automatically formats it as a whole number instead of k...

Specifying Cell Format in CSV File

I am generating a csv file from a PHP array. It opens just fine in Excel and OpenOffice Calc, however the data in one of the column are zip codes. Excel makes the cell formats of the column number general by default. This results in the leading 0 getting dropped in zip codes. Is there any way I can specify the cell formats within the...

How to read Excel cell from VB.Net

How can I read specific cell from Excel file using OLEDB Connection with VB.NET? Can you show me sample code? Thanks in advance! Best reagrds, thlaing ...

import excel data to gridview C#

hi... i need the code for import excel data to gridview in windows forms application... Plz anyone can tell me that code.... ...

Why does my Excel add-in only half work?

I've created an Excel add-in using Visual Studio 2008. It has a ribbon, a bunch of panes and code that adds sheets and ranges and gets information scraped from a web page. When I run it on my dev PC it works perfectly. I used the Publish command to publich it and installed on a Windows XP virtual PC. The installation seemed fine and whe...