excel

Tables in Excel with VSTO

Hi, I'm really new to VSTO so sorry if this is a newbie question. I'm working on a data entry application where I need to have the user get data into an excel table (e.g. when you highlight a bunch of rows and click "Format As Table"), then I need to read the data in from that table and work with it in C#. At a basic level, I've got a ...

Pass Data into a VSTO Excel Workbook?

Hi, I've got an VSTO Excel Workbook project that I'm using to gather information from a user. This workbook is being launched from inside of a host application, but I need to pass some parameters to the workbook before opening it so it knows what to display and how to display it. What's the best way to do this? ...

(Excel 2002) Pivot Chart Loses Data Selection option after Deselection

I have a Pivot Chart with data used as row labels. When an option is deselected, the option disappears from the filter list and has to be readded back, which is non ideal since it has been relabelled and the relabelling is lost when that data field is added back in. Before deselection: http://farm4.static.flickr.com/3364/3661401099_c76...

How to import excel files into SqlDatabase .mdf file

I have one long excel sheet with books details of a library..can i import this data into a .mdf file. ...

How Sharepoint enables editing data via Excel?

a Sharepoint Web Query allows saving changed Excel cells back to the server. It's quite simple to come up with a custom JSP(or any other dynamic html producer) page to produce data called in QYI file. My question: is there a way to handle in a JSP page changes in the Excel List when "Synchronize with Server" menu clicked in Excel? othe...

Problem in WHERE clause (don't know how I can address results from DECODE() function in WHERE clause).

I have a rather simple PL/SQL query (...) DECODE(upper(Table.Column), 'SOMETHING', '---', TABLE2.COLUMN2) as VALUE (...) How can I apply the WHERE clause using above statement, because when I use something like: WHERE upper(VALUE) like 'SOMETHING' it gives me an empty recordset (and I am absolutely positive that there are records w...

How do I open a file that is opened in another application

I have an winforms application that loads in excel files for analysis. Currently, in order to open the excel file the file must not be already open in excel otherwise a FileIOException is thrown when I try and load in the file. What I would like to do is allow my application to read in the file even if it is open in excel rather than fo...

How to export only selected columns to excel in c#?

Hi, I want to export only user selected columns to excel rather than exporting all the columns. Is there any way of achieving this functionality in C#? ...

Getting Excel 2003 to interpret a pasted number with leading zeros as text (works fine in 2007)

Hello I know there are other similar threads on SO, but they suggest formating the cells to text and/or prefixing the cells with a '. I've done them both, and it works fine in Excel 2007, but when I open the exact same Excel template in Excel 2003 and paste the same source, it removes the leading zeros. Are there any other possibilitie...

Dataset to excel

Hi. I'm developing an application that as to export a dataset to excel, this dataset have 3 tables and the relation between them, I would like to export this to a single excel sheet where for each parent table there is a '+' sign that when expanded shows the child values related to it. To export a single table to excel I know how to do i...

Excel VSTO sort dialog box C#

I'm trying to rewrite some VBA code in Excel VSTO. The VBA code is as follows: Application.Dialogs(xlDialogSort).Show When I try to do the same in VSTO I find that the same method needs 30 arguments! The signature is "Show(object Arg0,object Arg1, etc.)" Globals.RiskViewerWorkbook.ThisApplication.Dialogs[XlBuiltInDialog.xlDialogSort...

Dialog.Show Args

Does anybody know what the args are in the VSTO Excel dialog.show function? i.e. I would like to set the Sort Option to select "Header Row" but have no idea how to do this as I can only get the function working by passing missing in for every arg. Globals.RiskViewerWorkbook.ThisApplication.Dialogs[XlBuiltInDialog.xlDialogSort].Show(mis...

How to export the results of a stored procedure directly to a MS Excel file?

I found a way to extract the contents of a MS Sql table directly (faster) to excel. But I do not know how to do this with a stored procedure that requires parameters. Is it possible to extract, directly, to an Excel File the results of a stored procedure? I know how to do it indirectly (using a data table) but it is too slow. Thank you v...

Excel interop: _Worksheet or Worksheet?

I'm currently writing about dynamic typing, and I'm giving an example of Excel interop. I've hardly done any Office interop before, and it shows. The MSDN Office Interop tutorial for C# 4 uses the _Worksheet interface, but there's also a Worksheet interface. I've no idea what the difference is. In my absurdly simple demo app (shown belo...

Making a lottery program in Java

I was wondering, what do i need to look at to get cracking with making a programme that can read from a excel file I was thinking of making a programme that uses a excel spreadsheet and reading them in and generating a list of combinations that have not occured yet Its just for a bit of fun, but could be a good challenege thanks ...

macro problem

I'm trying to run the below mentioned code in VB(Excel Macro) but i m stuck with an error which pops up on running saying "Automation Error". strComputer = "." Set objNetwork = CreateObject("Wscript.Network") Set fs = CreateObject("Scripting.FileSystemObject") Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2"...

Is there any way to make Excel preserve XML attributes in root element?

I've been experimenting with using MS Excel 2007 to edit tabular data stored in an XML file. It does a nice job of importing and even validating the XML data against the schema (xsd file), but when I export, it drops the xmlns, xlmns:xsi, and xsi:schemaLocation attributes from the root element. It also changes the default namespace to an...

How to change Named Range Scope

When I create a named range through the Name Manager, I'm given the option of specifying Workbook or [worksheet name] scope. But if then want to change scope, the drop-down is grayed out. Is there a way, in either Name Manager or, preferablly, VBA to change the scope of an existing named range? For example, 'testName' refers to 'shee...

Using Python to replace MATLAB: how to import data?

I want to use some Python libraries to replace MATLAB. I'd like to know how could I import excel data in Python (for example using numpy) to use them. I don't know if Python is a credible alternative to MATLAB, but I want to try it. If you have any tutorial I'd be glad to read it! Thanks a lot! ...

Move data from Excel to Word and reformat it

Hi, is there a way to move the data from an excel sheet to a word document and reformat it. I'd like the data in the first column to be formatted as 'Heading1' and the data in the second column to be formatted as 'Normal'. So that every row results in a header and a content, but without a table itself. ...