excel

Excel VBA pastelink run-time error 1004: Application-defined or object-defined error.

I am trying to create a link from a cell on one sheet to a cell on the other sheet, but when I run it I get this runtime error: Application-defined or object-defined error. Here is the code: Worksheets(sheetFrom).Cells(fromRow, fromCol).Copy Worksheets(sheetTo).Cells(toRow, toCol).Select ActiveSheet.Paste Link:=True I am checking th...

copy data from sheet 1 to sheet 2 in the same workbook in excel

Hi all, An excel sheet (sheet 1), gets updated on a daily basis by the Admin dept. I need to copy this data in sheet 1 to sheet 2 automatically in the same workbook. Is this possible? If so, pls help me with this. Thanks in advance. ...

Using Excel VBA to find a range

I have been given some workbooks which are formatted for the eye rather than anything functional. As such, I have quite a few column headings that look like this: A B C D E 1 'YTD 'Monthly 'YTD 'Monthly 2 Figures' Figures' Plan' Plan' 3 4 Account1 1 ...

stop 2nd question after save to XML format?

How can i get my Excel xls file that is password protected to stop asking me if i want to convert it to an XML file format? ...

How can I convert an Excel file to CSV with Perl's Spreadsheet::WriteExcel?

I have an Excel sheet and am able to convert it into .csv format using Perl. My only problem is that some of my data in the Excel sheet cells contain commas and that has to be retained in the CSV format also, but while converting it takes as a seperator. How can I retreive the data in the cell with commas as it is and print it in the ...

Is it possible to control when the activeX warning appears in Excel 2007

We have an Excel spreadsheet with an ActiveX control on one of the VBA forms. We are getting an ActiveX security warning popup - this is expected and perfectly fine. The odd thing is that sometimes the warning appears when you first open the workbook, and sometimes it doesn't appear until the form the control is used on is opened. As ...

Excel or Access

What I am trying to do is make a form in Access and with out having to cut and paste over and over again have it ascend by rank, the problem with this is that lower ranks have letters closer to one if I have a list like this Cpl 4th rank MSgt 8th rank but it is a higher rank then Cpl 1st lt is is like the 11th ranking etc.. yes the 1st...

ADODB.Connection undefined

Reference http://stackoverflow.com/questions/1690622/excel-vba-to-sql-server-without-ssis After I got the above working, I copied all the global variables/constants from the routine, which included Const CS As String = "Driver={SQL Server};" _ & "Server=**;" _ & "Database=**;" _ ...

Is there much overhead involved in VBA classes?

Hello, Is there much overhead involved in VBA classes? I noticed that on a previous workbooks I effectively did the same thing as what's currently in my classes, but it ran faster. ...

Excel COM Add-In dialog interrupts script

Hi all! I have written an Excel COM Add-In in C++ for automation of Excel with VBA. It contains an own dialog showing some general informations about the Add-In. Now i create a button in Excel that opens the dialog. Leaving the dialog with the escape key leads to an Excel message that the script is being interrupted instead of just clos...

JSP response content type Excel

when i set response content type is excel. In excel sheet it is dsiplaying 1-Jan instead-of 1-1. here is code snippet <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <% response.setContentType("application/vnd.ms-excel"); %> < table>< tr>< td>1-1< /td>< /tr>< /table> Appending s...

Parsing excel sheet in C#, inserting new values into database.

I am currently working on a project to parse an excel sheet and insert any values into a database which were not inserted previously. The sheet contains roughly 80 date-value pairs for different names, with an average of about 1500 rows per pair. Each name has 5 date-value pairs entered manually at the end of the week. Over the week...

How to find the named range of a cell - VSTO

I have generated a series of rows using C# and VSTO. I have basically loaded a couple of rows with data and have given each cell a NamedRange. My question is how would I, knowing the beginning row and end row index, traverse each cell and retrieve it's NamedRange. I've tried Excel.Range range = (Excel.Range)m_worksheet.Cells[x,y]; which ...

Are we unable to use Interop objects in generic objects in .NET 4.0?

I'm working in VS 2010 and working on upgrading our application to .NET 4. The application is build with Excel as the base and we want to take advantage of some of the improvements to .NET for using Excel. But I ran across a strange error that seems to be caused by using an Excel Interop object in a generic dictionary. Here is the err...

How can I create a CSV file from unequal length arrays in Perl?

I have to parse a file so that I can import it to excel. So, I thought the best way was to create a csv file. In this file, I have to divide contents into different categories and represent them in different columns. So, I have parsed the file to create different arrays corresponding to the categories. Now, I am trying to create a csv fi...

Form wont stay on top. How do I keep my excel form from hiding behind other windows after I browse for file?

I have a vb.net program that opens up an excel workbook and runs a macro ("Report") in that workbook when a button is clicked. //Workbook with macro and form xlWorkbook = xlApp.Workbooks.Open("W:Data\Excel Program.xls") //Macro: xlApp.Run("Report") //Macro opens form from workbook. I browse for my two .csv files //and the...

How to do: sum columnB where columnA is XYZ - in Excel?

Hi I have a bunch of columns and some columns which are values I need to add. Lets say I want to sum columnB (which could be $) where column A is banana, how do I do that? Thing is I have a huge dataset and it is something that is going to keep changing. And besides banana, i might have apples, oranges, etc. And I want to sum the $ val...

Read the ActiveCell content in Excel using VSTO

Hi there, I'm trying to read the ActiveCell from within an Excel Add-in but not getting very far. Anyone any ideas? Excel.Window W = this.Application.ActiveWindow as Excel.Window; Excel.Range R = W.ActiveCell as Excel.Range; MessageBox.Show(R.Value2.ToString()); The Exception being thrown on the last line is: - Cannot obtain fiel...

setting Excel cell format from C# using late binding

I'm using late binding to launch Excel from C# and copy data into it (Type.GetTypeFromProgID("Excel.Application"), Activator.CreateInstance, InvokeMember, and all that). I have this working fine, but I can't figure out how to set the cell format, specifically to make a cell bold. anyone have any idea how to do this? ...

Custom LINQ provider for Excel spreadsheets?

Does anyone know a good custom LINQ provider to query data from Excel spreadsheets? ...