excel

Exporting gridview to excel with combo,checkbox type columns + winforms

Hi, I want to export grid view data to excel file in windows forms application. I tried one solution but it fails to export combo box type column to excel. Excel file should have combo box, check box columns. Thanks.. ...

Need to place a floating modeless form over excel main window (quasi-task pane)

Hi I need to emulate a task pane by floating a modeless form over the Excel main window. The reason for this requirement is that I need to have taskpane features for my Excel 2003 add-in, but cannot use the document-centric model. Can anyone suggest what would be the best way to do this? The modeless form would need to detect the ma...

Making ThisWorkbook talk with ThisAddIn

I have a solution containing an VSTO Excel AddIn project and an VSTO Excel Template project. Is there any design pattern (or hack) that can allow the ThisAddIn instance to access properties and methods of the ThisWorkbook instance, and vice versa? Also I should note that I'm using VS 2008, VSTO 2005SE, and the target Office version i...

Problem registering a COM server written for Excel registered on client machine (can't set full path to mscoree.dll)

In this previous question <How to get COM Server for Excel written in VB.NET installed and registered in Automation Servers list?> there is an example of how to create the full path to a registry key using VS 2008. Everything in the previous answer works correctly except the full path that I am setting (using the registry editor in VS) f...

C# Class Library wont register for COM

Hello All, I am trying to gain access to a .NET class library in Microsoft Excel. To do this I know that the .NET class library must be registered with COM. So I tried going to my Assembly Info and Setting COM Visible to true. Then on the build tab I set Register for COM Interop for true also. I checked the AssemblyInfo.cs file and it do...

Output a NULL cell value in Excel

I have an IF statement. If a cell = n, then do something, else output NULL =IF(A1=5, "Success", NULL) // #NAME? =IF(A1=5, "Success", "NULL") // NULL (as in text, not actually NULL!) =IF(A1=5, "Success", "") // blank but not NULL =IF(A1=5, "Success", 0) // zero value but not NULL ...

How do I repeat function over several row.

I'll admit that I'm not an Excel guru so maybe someone here can help me. On my worksheet I have several blocks of data. I calculate the sum of all items within column D of that block. Within each block I am checking the value of the cell in column C and if it contains the letter "y" and the value in column D of that row is equal to zer...

SSAS 2008/Excel 2007 - Can't see cube

I have created a cube in SSAS 2008. In BIDS and SSMS I can see it fine. However, I cannot connect through Excel. I have tried both Excel 2003 and Excel 2007. I must support both and neither work. I can see the database but the cubes do not show up. I created a dummy cube in the project using the wizard and deployed that to the same dat...

How do you set the "global delimiter" in Excel using VBA?

I've noticed that if I use the text-to-columns feature with comma as the delimiter, any comma-delimited data I paste into Excel after that will be automatically split into columns. This makes me think Excel must have some kind of global delimiter. If this is true, how would I set this global delimiter using Excel VBA? Is it possible to...

JAVA Excel POI API: Problem

Hi All, I am using the Java POI package to access the excel files. I have an excel file for which i am updating the cell values. those values are being used in some other sheets (within the same excel file) however, when i open the file, those values don't updated. when i select the cell text and hit enter then all the remaining sheets g...

Mass saving xls as csv

hi, here's the trick. gotta convert 'bout 300 files from xls to csv, wrote some simple macro to do it, here's the code: Dim wb As Workbook For Each wb In Application.Workbooks wb.Activate Rows("1:1").Select Selection.Delete Shift:=xlUp ActiveWorkbook.SaveAs Filename:= _ "C:\samplepath\CBM Cennik " & ActiveWorkbook....

Using Excel VBA to Create SQL Tables

Hi All, I am trying to use Excel VBA to automate the creation of a SQL table in an existing SQL Database. I have come across the following code on this side. Private Sub CreateDatabaseFromExcel() Dim dbConnectStr As String Dim Catalog As Object Dim cnt As ADODB.Connection Dim dbPath As String Dim tblName As String 'Set databas...

Excel VBA SQL Import

Hi All, I have the following code which imports data from a spreadsheet to SQL directly from Excel VBA. The code works great. However I am wondering if somebody can help me modify the code to: 1) Check if data from column A already exists in the SQL Table 2) If exists, then only update rather than import as a new role 3) if does not ...

Excel VBA to Create SQL Table

Hi All, I have found the following code which is suppose to create a SQL table within a SQl Database. The database is specify in dbpath and the table to be created is in tblname. However when i run this code i have a problem finding to right SQL database. For example if i specify the dbpath as "WIN2k8\Test\ABC" ie the machine name i...

Excel VBA SQL Data

Hi All, I have a small excel program. I would like to be able to use this program to update a SQL table. What would be the function to say update line 2 in SQL table Test in Database ABC Thanks ...

How to force ADO.Net to use only the System.String DataType in the readers TableSchema.

Howdy, I am using an OleDbConnection to query an Excel 2007 Spreadsheet. I want force the OleDbDataReader to use only string as the column datatype. The system is looking at the first 8 rows of data and inferring the data type to be Double. The problem is that on row 9 I have a string in that column and the OleDbDataReader is returni...

Excel export displaying '#####...'

I'm trying to export an Excel database into .txt (Tab Delimited), but some of my cells are quite large. When I export into a txt some of the cells are exported as '#######....' which is surprisingly useless. Has this happened to anyone else? Do you know an easy fix? Data from one cell of my column: Accounting, African Studies, Agri...

vba Loop over a non-contiguous range

I have a non-contiguous range on rows (example address of myRange: $2:$2,$4:$205,$214:$214) and I would like to access a specific row and column within the range. I have tried the following: 'Get the value of the 2nd row, 1st column within the range myRange.rows(2).Cells(, 1).Value However, this is giving me the value of the 2nd row ...

export to excel from vb.net from sql datareader

I have an sql query with sql datareader. i put a for loop for the data reader. now when the data starts coming in from the query i want it to export to excel in the for loop. here's my code Try Dim SqlStr As String = "", dr As SqlDataReader = Nothing ConnectDB(Cnn) Str = "query" SqlCmd = New SqlComma...

classic asp delete rows and columns from an excel file

Hi, how can I remove specific rows and columns from an excel file using only classic ASP? For example, given the excel file col1 col2 col3 one two three four five six I want to be able to programmatically delete the first row and second column to produce one three four six Thanks! ...