excel

Reading an Excel Sheet containing 10000 Rows In C#.

While the Jet OleDB Driver is pretty simple to use for reading an Excel sheet, it simply cant handle excel files having rows more than a thousand. Is there any other way of reading more than 5-10k rows from an excel sheet in C#? ...

Is there any simple way to convert .xls file to .csv file? (Excel)

Hi Is there any simple way to convert .xls file to .csv file ? (Excel) in C# code ? i mean to take an existing .xls file and convert hem to .csv file Thanks in advance ...

Make Excel Defined Names within a worksheet to be global

Hi, I wrote Powershell script to copy a worksheet from a workbook A to another workbook B. The worksheet contains define names for ranges within that sheet. Originally, the defined names are global in workbook A, ie. can be referenced from any worksheets within workbook A. But now, after copy to worksheet B, the defined names are limit...

How to effectively use WorkbookBeforeClose event correctly?

On a daily basis, a person needs to check that specific workbooks have been correctly updated with Bloomberg and Reuters market data; i.e. all data has pulled through and that the 'numbers look correct'. In the past, people were not checking the 'numbers' which led to inaccurate uploads to other systems. The idea is that 'something' nee...

Trying to open a excel template and rename or save to new location

I get the following error message when I try the following: Dim XL As New Microsoft.Office.Interop.Excel.Application XL.Visible = True XL.Workbooks.Open(XLTemplatePath) XL.SaveWorkspace(XLSaveReportPath) XL.Workbooks.Close() XL.Workbooks.Open(XLSaveReportPath) "Excel cannot open the file 'ContactReports.xlsx' b...

Excel Macro to create sheets

I have a Excel sheet with two columns and I need to create new sheets based on the values of the first column.ie A B test1 Value21 test1 Values22 test2 Value21 test2 Value32 test3 Values32 IN this case I need to create three sheets namely test1,test2 and test3 Sheet 1 should contain test1 field and its correspon...

Can't change pivot table's Access data source - bug in Excel 2000 SP3?

I have a set of Excel 2000 SP3 worksheets that have Pivot Tables that get data from an Access 2000 SP3 database created by a contractor who left our company. Unfortunately, he did all his work on his private area on the company (Novell) network and now that he has left us, the drive spec has been deleted and is invalid. We were able to ...

Macro to copy data from one sheet to another based on the current date

Does anyone have a macro that copy data from one sheet to another based on the current date? I am working with a single workbook of three sheets. Sheet one will hold the manual input of daily production figures for multiple plants, sheet two is to hold ongoing daily data, keyed on sheet one. The macro will be associated with a button,...

Best Way For Copying Filtered List In Excel From One Session To Another?

I have a huge excel file - I want to copy a subset of rows from one file to another If I filter data I can copy those filtered rows but I cannot find a way of pasting just those filtered rows into another workbook which is also filtered Does anyone know an easy way to do that? ...

number of days in a period that fall within another period

I have 2 independent but contiguous date ranges. The first range is the start and end date for a project. Lets say start = 3/21/10 and end = 5/16/10. The second range is a month boundary (say 3/1/10 to 3/31/10, 4/1/10 to 4/30/10, etc.) I need to figure out how many days in each month fall into the first range. The answer to my example a...

excel 2007 vba: how to refer to HPageBreaks

I'm trying to write a macro which can look into the list of horizontal page breaks that a worksheet keeps, and it seems like HPageBreaks should be exactly that. I can add or remove page breaks from it, but I can't seem to isolate the collection itself to look at its contents. Even adding a watch and looking at ActiveSheet.HPageBreaks j...

an HTML file is NOT an Excel file, right?

we use an application that has an "export to excel" feature that doesn't work on PC's that done have outlook express installed. i know, you're thinking "WTF does outlook express have to do with excel files?" i asked the same thing, and here's what i found: the file being generated is actually one of those Microsoft Single File Web Pa...

How to code Microsoft Excel "Shift Cells Up" feature in SQL

Take a simple table like below: Column Headings: || Agent's Name || Time Logged In || Center || Row 1: Andrew || 12:30 PM || Home Base Row 2: Jeff || 7:00 AM || Virtual Base Row 3: Ryan || 6:30 PM || Test Base Now lets say that a single cell is deleted so the table now looks like this: Column Headings: || Agent's Name || Time ...

How Display Excel rows on selection of first Excel Column Value

Hi, I have Two Excel sheets. My requirement is when i select Reason Value From First Excel sheet Reason Column. It will display respected Reason Value in Second Excel. So using Macro i want to Display Second Excel Rows on selection of reason in first excel. Please Help. First Excel is And Reason Column Contains Reason1 , Reason 2 et...

Determining actual args an Excel UDF was called with.

I'm adding a user defined function to Excel with varargs-based signature in C++: LPXLOPER MyFunction(...); When Excel calls MyFunction, it passes it 30 arguments regardless of how many the user entered in the sheet. The extraneous ones are blank strings. MyFunction, however, is designed to accept empty string arguments. As a result, ...

Excel VBA - How to copy/transpose multiple columns record into individual single row

I'm working on data migration, need some help on doing a macro to copy/transpose multiple columns record into individual single row. There are also a "tag" in the first row, which indicates the columns that should not be included in the copy/transpose. From: Tag . . . . . . . . . .x Name Jan Feb Mar Apr Larry 2 2...

Export to Excel from dataset with out using htmltextwriter

Export to Excel from dataset with out using htmltextwriter Hey, I'm having an issue occuring when I want to import data back into a table from a file. My export creates a file successfully as a .xls file. However, my contents for the file are being written as standard html table as seen below rather than the file content that normal e...

Excel Reader ASP.NET

I declared a DataGrid in a ASP.NET View and I'd like to generate some C# code to populate said DataGrid with an Excel spreadsheet (.xlsx). Here's the code I have: <asp:DataGrid id="DataGrid1" runat="server"/> <script language="C#" runat="server"> protected void Page_Load(object sender, EventArgs e) { ...

Query string length limit in vba?

I am trying to combine multiple audit tables, and then filter the results into an excel sheet. The Union All and parameters make the query in excess of 1200 characters. It appears the string is truncated when running this. What recommendations can anyone make. I have no control over the database structure and am only reading foxpro free ...

How to use Excel VBA to extract Memo field from Access Database?

I have an Excel spreadsheet. I am connecting to an Access database via ODBC. Something along then lines of: Set dbEng = CreateObject("DAO.DBEngine.40") Set oWspc = dbEng.CreateWorkspace("ODBCWspc", "", "", dbUseODBC) Set oConn = oWspc.OpenConnection("Connection", , True, "ODBC;DSN=CLIENTDB;") Then I use a query and fetch a result se...