8 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Reverend Jim

Several people have asked how to export data to Excel. This code snippet shows how to export the data from a listview in details mode to a new Excel spreadsheet. Take note of the comments in the header to avoid having orphaned Excel.exe tasks eat up your system memory.

Member Avatar for Reverend Jim
7
9K
Member Avatar for djjeavons

This code snippet demonstrates how to use ADO.NET to read the contents of a Microsoft Excel Worksheet. This snippet also demonstrates the use of the [GetSchema](https://msdn.microsoft.com/en-us/library/ms135981%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396) method to determine what worksheets are available within an Excel workbook allowing the end user the ability to select a specific worksheet in order …

Member Avatar for vivek_sharma
2
2K
Member Avatar for ddanbe

After reading this excellent [code snippet](https://www.daniweb.com/software-development/csharp/code/492766/display-excel-data-in-a-datagridview) by djjeavons, and just trying to learn WPF, I decided: "Well, let's translate that to WPF!". It was a bit harder than I thought, but a great learning experience! Her's how my screen in action looks: ![WPFscreen.png](/attachments/small/1/ac05d33ccd8a190d0576fa063e54749f.png "align-left") Things that changed compared to the …

Member Avatar for ddanbe
1
541
Member Avatar for djjeavons

This snippet demonstrates how you can add VBA code to an Excel file at run time. **Prerequisites** In this snippet I am using Microsoft Excel 2013 with the Microsoft Excel 15.0 object library. Before you can use this code, you will have to change a setting within Microsoft Excel to …

0
1K
Member Avatar for Reverend Jim

If your Excel spreadsheet is laid out as regular columns and rows with a header row that identifies the columns then this code will allow you to read the data using ADODB the same way you would read records from a database table. To try this code 1. Create a …

Member Avatar for Reverend Jim
1
4K
Member Avatar for Klahr_R

A simple timer for Excel VBA Excel VBA does not have a timer control. The alternative is to use the Timer() Function, and that leaves much to be desired. This code should be placed in a code module. My need was to tend to an abandoned program that was waiting …

Member Avatar for Bloodseeker
0
3K
Member Avatar for imti321

'the code is working properly only problem with this code is when the first line ends in excel and data is inserted in next Row "instead of inserting another row it copies the same content which is inseted last time in form "

Member Avatar for tinstaafl
0
381
Member Avatar for serkan sendur

The End.