Click here to Skip to main content
15,892,059 members
Everything / Productivity Apps and Services / Microsoft Office / Microsoft Excel

Microsoft Excel

MS-Excel

Great Reads

by Alex Pumpet
A simple program for comparing table data from two sources - SQL databases, Excel, CSV or XML-files
by yuvalsol
Create professional-looking Excels (Filters, Charts, Pivot Tables) with EPPlus
by William Hey
Classical number theories
by Bert O Neill
Query Hadoop using Microsoft oriented technologies (C#, SSIS, SQL Server, Excel etc.)

Latest Articles

by Erik Drent
A simple POCO mapper for EPPlus
by W. García
VBA solution for CSV parsing problem
by Gustav Brock
Format amounts in VBA using the Indian number format for currency and amounts
by IvanFeng
With AutoExcel, you can quickly import and export Excel without hard coding, and embrace changes.

All Articles

Sort by Updated

Microsoft Excel 

23 Mar 2024 by namphongjst
I make more time on it so it is solution, may be help someone : firt you get excel format by function public static string GetExcelCellFormat(string cellFormat )//= "G") { // MessageBox.Show("ok date !" + cellFormat); ...
23 Jan 2024 by Dave Kreskowiak
What is calling this DynamicDropDown method? Whatever that is needs to check to see what is being clicked on is an object that is valid for the call to DynamicDropDown to succeed.
22 Jan 2024 by Faisal faisal from Vsevolozhsk
I have write a code that create dynamic drop-down list without any blank and it works very good, but the only problem is when I run the marco while I am clicking any object (pictures, buttons, etc..) it shows Run-Time error '1004'...
22 Jan 2024 by Maciej Los
Try to split this line: .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=Join(Application.Transpose(valuesArray), ",") into: Dim result As String result = Join(Application.Transpose(valuesArray),...
18 Nov 2023 by Erik Drent
A simple POCO mapper for EPPlus
16 Apr 2023 by Sh.H.
I found my answer from Stackoverflow. appRef.BringToFront
4 Apr 2023 by Member 13891176
I'm trying to upload a file (xlsx) to mysql and I keep getting the same error when trying to submit. "127.0.0.1 is currently unable to handle this request". Any advices? What I have tried:
14 Nov 2022 by 283
using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Web.UI; using System.Web.UI.WebControls; using ClosedXML.Excel; namespace JqueryTutorial { public partial class WebForm1 : System.Web.UI.Page ...
6 Sep 2022 by Dave the Golfer
I have written a VB.net application that uses Excel to create printed reports. The application works on my desktop. I then created an self loading exe to load it onto other machines. Using the exe I loaded it onto my laptop along with the XML files needed. All worked okay. However, I then loaded...
6 Sep 2022 by shahidul326
If you remove your 'Microsoft reference'(old or current reference) by Go> Project>Property>References*>Select "Microsoft Office xx Object Library" or/and Microsoft Excel xx Object Library" or/and Microsoft Word xx Object Library" > Click 'remove'...
6 Sep 2022 by mikcutu
hello,I was building an application under vb.net 2008 which worked OK.Now, I was trying to migrate it into vb.net 2010 and I still receive errors relate to different ambiguous in namespace Microsoft.Office.Interop.Excel. This is refering to DataTable, Workbook, Worksheet,...
28 Jul 2022 by Member 10364224
Can anyone tell me how to convert excel file into images using C# code and Microsoft.Office.Interop.Excel lib?Using Microsoft.Office.Interop.Excel; string fileNameToProcess = @"C:\Users\infoobjects\Desktop\Test1 Single sheet.xlsx"; //Start Excel and create a new...
28 Jul 2022 by Member 15230079
string fileNameToProcess = Station; //Start Excel and create a new document. Microsoft.Office.Interop.Excel.Application oExcel = new Microsoft.Office.Interop.Excel.Application(); ...
15 Jul 2022 by Govardhanudu Gajula
Hi friends, when i am trying to get the data from Gridview to excel data, when i am open the excel file, the file you are trying to open fileanme.xls is in a different format than specified by the file extension, when i click yes in that time only excel is open, but my client requirement is we ...
16 Jun 2022 by RedDk
Stack Overflow - tags("Photoshop") ... pick one (type "Photoshop" into the textbox control to the left of the magnifying glass)[^]
16 Jun 2022 by Sh.H.
I have this code in VB Excel. This code, will run Photoshop and then automatically run the script which name is 'MyPSScript'. CreateObject("Photoshop.Application").DoJavaScript ("D:/MyPSScript.js") The problem is when the Photoshop starts, it...
11 Jun 2022 by behruz12
Hi maybe this help you: =lower(text) =lower(true)
11 Jun 2022 by Maniraj.M
Hi all i have an CSV format file that contains string "true" and "false" but that CSV file from Excel 2010 it automatically converts to Upper case.I need same as lowercase string.How to resolve the problem???Thanks in Advance
1 Jun 2022 by Member 15658675
Thanks Mark! I was facing the same issue on an upgrade to Windows Server 2019. Added the Desktop folder to C:\Windows\SysWow64\Config\SystemProfile. Problem SOVLED!!!
28 May 2022 by Member 15653559
Hello World ! I'm new here and I'm so much interested on anything as per skills learning and training with to gained more experiences and work with experts to becomes expert in due times frame. Thanks for your co-operation
18 Dec 2021 by cyphersnap
Hello, I'd like to display the text of a cell in a sheet of excell in another sheet of the same worksheet so that when the first change the second will sync dinamically. How to do that? Thank you. What I have tried: I have found wais to link cells with formula; I have not found the solutio...
18 Dec 2021 by Member 15472400
solution 1 gives me 0, not the text in the cell I want to display
8 Nov 2021 by Member 10223212
hello I have bulk images in folder and i want copy these file name to excel file Note, I want only all file name not images..........
26 Oct 2021 by planetz
Hello everyone,Hope you are doing great..!!I have this excel sheet and I need to count blank cells from a range till a non blank cell is reached.A | B | C | D | E | F | G | H | Countx | x | - | - | - | x | - | - | 2x | x | - | - | - | - | - | x | 0In first row since the...
26 Oct 2021 by Member 15408878
You can try this, we have the same problem, was able to come up with this. (Thanks Google) Works great with pivot tables. Formula is in I1. =COLUMNS(A1:H1)-XMATCH("*?",VALUETOTEXT(A1:H1),2,-1)
5 Sep 2021 by rachu223
Hello Everybody,We have created dynamic column chart using Microsoft word interop. Chart is generated successfully but sometimes it loads fresh chart or sometimes it takes data itself and generate chart with dummy data.Our code is as below. object bookmarkName =...
5 Sep 2021 by 依建 Lǐ Jiàn林 Lín
//Create an instance for word app Microsoft.Office.Interop.Word.Application winword = new Microsoft.Office.Interop.Word.Application(); //Set animation status for word application winword.ShowAnimation =...
14 Jun 2021 by TassadarNET
Hello Paul, I've try to use your great code "C# How To Read .xlsx Excel File With 3 Lines of Code" to extract content cells of a simple sheet. My problem is I can retrieve the column number with cell.ColumnIndex and cell content with cell.Text, but I don't know how to get the row number of the...
14 Jun 2021 by Member 15245413
Then try with cell.Row and cell.Column. There is no cell.Column, but many thanks for the try. I've finally use NPOI and it already works Regards Can U give me solution of yours?
7 Jun 2021 by Member 15235350
Microsoft Office 2007 only came in 32-bit. To confirm this, first open a microsoft office product. Open the task manager by pressing Cntl+ Shift + Esc. Then make sure you are in the Processes tab. Find the office 2007 program you are...
15 Mar 2021 by Rash24Agg
Hi, I am a newbie to this platform and also to running MS Office applications with .Net. I am trying to export data from datagridview to excel sheet on click of a button. Here's my code : Dim xlApp As...
15 Mar 2021 by Richard MacCutchan
You are trying to use the Excel ApplicationClass to initialise the Application object: xlApp = New Microsoft.Office.Interop.Excel.ApplicationClass It should be: xlApp = New Microsoft.Office.Interop.Excel.Application
12 Mar 2021 by Richard Deeming
Rather than using Office Interop, use a library which creates an Excel file directly. That way, it doesn't matter which version of Office your users have installed - your code will still work if they don't have Office installed at all. ...
8 Mar 2021 by W. García
VBA solution for CSV parsing problem
3 Mar 2021 by Member 10696161
Hello, I'm trying to save data as excel from datagridview from another panel, but first I have to retrieve all from Mysql database. private void btn_Retrieve_all_Click(object sender, EventArgs e) { string conn2 =...
3 Mar 2021 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable, property, or a...
27 Feb 2021 by Stefan_Lang
In my excel worksheet I am using automation to insert formulas like this: worksheet.Cells[X_index][current_row_index].Formula = "=AC17+ABS(100*$Y$10* COS(((G17+J17+M17+Q17-180)*PI/180)))"; or worksheet.Cells[X_index][current_row_index].Formula =...
26 Feb 2021 by Maciej Los
As @embar.k.adero mentioned, when you use local names of functions (in your nativve language), you have to use FormulaLocal[^], but when you want general solution (no matter of regional settings), you have to use Formula with English names and...
15 Feb 2021 by Gerry Schmitz
Data Analysis in Excel - Easy Excel Tutorial[^]
11 Feb 2021 by my name is coder ! ! !
Hi . I have Excel as follows: I want to get the information as below on the main page, and link it by class on the next pages. I do not know if I should create a form or a button or something. Also, the class column should be a drop-down list....
11 Feb 2021 by CHill60
Here is Microsoft's instruction page for creating a drop down list in an Excel spreadsheet - Create a drop-down list - Office Support[^] As for getting the data onto the other pages you have several options Most up to date and advocated by...
11 Feb 2021 by The Mentee
My code works as SUMIFS function does. Below code just completes this below formula that is. =SUMIFS(Inventory!$C$2:$C$500000,Inventory!$B$2:$B$500000,'Current Stock'!B2,Inventory!$A$2:$A$500000,'Current...
9 Feb 2021 by Patrice T
I have an Excel 2003 workbook which include VBA functions. Suddenly, the code crash with no error, no message, nothing, just a #Value in the cell. The only hint is that this PC is on Windows 10, most of other PCs are W7. Crash is on Set re =...
9 Feb 2021 by Patrice T
Last news: suddenly, it works again. My search lead me to an information which is that MS desactivated RegEx on IE on W10 a few weeks ago. Today, all workbooks that crashed since 3 weeks are working nice again. In between, programmed a solution...
7 Feb 2021 by Dave Kreskowiak
How about asking this in the forums for Photoshop? You're going to find the most experience with the product over there. Google Adobe Photoshop Forums[^]
2 Feb 2021 by DoubleD1982
I am very new to programming in general and am seeking some guidance on how to achive what I need to. I need to import an Excel file (Already doing so using DocumentFormat.OpenXml) and use the data in the Excel file to create an order header and...
2 Feb 2021 by Gerry Schmitz
You're implying the "invoice" portion is repeated / duplicated when there are multiple details. Therefore, keep adding details to your "OrderDetails" WHILE the invoice number is the same as the previous detail (as you read). Once the Invoice #...
1 Feb 2021 by Gustav Brock
Format amounts in VBA using the Indian number format for currency and amounts
28 Jan 2021 by rtksmithjoton123
I want to use SpreadsheetDocument to create some excel, but it always wait long time, last show the white page. What I have tried: I test the officail example, but it no effect. SpreadsheetDocument Class (DocumentFormat.OpenXml.Packaging) |...
28 Jan 2021 by Maciej Los
I'd avoid of using: Set re = CreateObject("VBScript.RegExp") I'd suggest to create Regex object via using reference to Microsoft VBScript Regular Expressions x.x.dll, where x.x is version number. Then, you'll be able to create object via...
28 Jan 2021 by RickZeeland
Take a look at NReco.CSV or FileHelpers: net-libraries-to-import-export-data-from-delimited-records[^]
28 Jan 2021 by thatraja
I did quick search & found these(with out error message). These might help you for sure. How to Fix Runtime Error 429 on Windows 10 and Earlier Versions - Appuals.com[^] ActiveX component can't create object or return reference to this object...
25 Jan 2021 by RishuMehra.Info
Hi Everyone,I've an Excel spreadsheet where so many URLs are mentioned by my client to edit them. So currently I go the each URL and open it manually in browser. Which takes up lot of my time and makes me sick of doing the same step again and again.Can someone please suggest me how to...
20 Jan 2021 by Member 14019423
Hi, I am using excel, I have 1000 rows in a sheet and I am selecting only the first 500 rows and then trying to print: Steps that I follow :Select first 500 rows>File>Print>Settings :a)Print Selection b) Collated c)Portrait d)Letter(8.5"*11'')...
20 Jan 2021 by Smart003
"Cannot run the macro ...The macro may not be available in the workbook or all marcros may be disabled" oExcel = CreateObject("Excel.Application") oExcel.Visible = False oBooks = oExcel.Workbooks oBook = oBooks.Open(Dts.Variables("filePath").Value.ToString()) //Your macro here:...
20 Jan 2021 by Member 15051662
Make sure a macro is assigned. In my case I created a button, Recorded a macro to use with the button, however I never actually assigned the macro to the button. Once I right clicked on the button, Selected assign Macro, selected the recorded...
16 Jan 2021 by Member 14898617
I am creating excel VSTO , where I already have the macro to delete excel rows based on column values(if it is greater than zero)which now needs to be converted to c# , by seeing documentation on internet I have come up so far , but still errors...
15 Jan 2021 by Member 14898617
i am creating add-in in excel to delete the selected range where the values is greater than 0 , but currently if more continuous cells contains greater than 0 values , it is deleting only 1 & 3 values(odd rows) and leaving the rest , kindly guide...
15 Jan 2021 by CHill60
I am not going to follow those links while I am at work. There is very rarely a need for an "image" with problems like this - just put the data into the body of your question - it has the advantage of making it easier for us to paste into a test...
15 Jan 2021 by OriginalGriff
While Gerry is right: Excel isn't a database, and using it as such will always give you problems when you try to do anything complicated; that isn't the root cause of your problem. Think about what you are doing: checking each row in a range...
14 Jan 2021 by Steve@Rozel
Moien clever Leit, Komplett nei op VB.NET (nëmmen haut Visual Studio 2019 installéiert). Fir alles ze starten wat ech wëll maachen ass Excel (Office 365) vun enger Netzwierkplaz op, loosst eis soen: - \\ Datei-svr01 \ Rozel \ Design \ Parts \...
13 Jan 2021 by houssem eddine ayari
I have two combobox (combobox1 in form 1 and combobox2 in form2). I need to import an excel file and the combobox1 gets the sheets name. Then in the form2 (I don't want to import the same file another time) i have combobox2 that have also the...
13 Jan 2021 by Member 15045156
using (OpenFileDialog openFileDialog = new OpenFileDialog() { Filter = "Excel 97-2003 Workbook|*.xls|Excel Workbook|*.xlsx |fichiers Textes (*.txt)|*.txt|fichiers CSV (*.csv)|*.csv|tous les fichiers (*.*)|*.*" }) { ...
13 Jan 2021 by IvanFeng
With AutoExcel, you can quickly import and export Excel without hard coding, and embrace changes.
12 Jan 2021 by OriginalGriff
Exactly how depends on the "relationship" between the two forms. Have a look at these, one of them will fit your circumstances. The form that creates an instance of another: MyForm mf = new MyForm(); mf.Show(); Is the "parent", the other form is...
12 Jan 2021 by ahmad shahoseini
We have a woocommerce shop site and we want to add category and description field to any products row (variations and variables)in our excel exported product file, now the category field and description field exist just for variables and not...
12 Jan 2021 by ShivKrSingh
Hi, I want to cast value while reading it from excel use oldDB. my code is below.DataTable dtOleDB = new DataTable(); string constr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + xlsFileName + "; Extended Properties='Excel 12.0 Xml;HDR=YES;'"; OleDbConnection...
12 Jan 2021 by Maciej Los
Depending on what you want to achieve, there's few ways to open and read/write Excel file - via: 1. Interop.Excel 2. OpenXML 3. third party providers (for example EPPlus) Ad 1. Microsoft.Office.Interop.Excel Namespace | Microsoft Docs[^]...
12 Jan 2021 by Ralf Meier
When you ask this to Google you get the following : vb.net open excel file - Google Search[^] Here you will find severall examples. I you have a special question feel free to ask it here.
12 Jan 2021 by houssem eddine ayari
Hello, I have an excel file containing different sheets. In my first form ,I need to import the excel and get data from the first sheet and in other 2 forms I need to import the same file and work with the other sheets. Can someone help me to...
6 Jan 2021 by Maciej Los
I'd suggest to read this: Odds Probability Calculator[^] Quote: Probability Formulas: This calculator will convert "odds of winning" for an event into a probability percentage chance of success. Odds, are given as (chances for success) :...
6 Jan 2021 by Zaur Bahramov
I'm having a difficulty to figure out how to distribute 2 percentages fields in 3. Let's say we have 2 teams. I think they both have chances 50/50 means that the draw has the percent of 50, 25 for the first team and 25 for the second team. So i'm...
3 Jan 2021 by Zaur Bahramov
Hi! I'm trying to refresh query from VBA and get the Run-time error 9: Subscript out of range. What I have tried: Here's my code: Private Sub cbRefreshLive() Dim wb As Workbook: Set wb = ThisWorkbook...
3 Jan 2021 by Zaur Bahramov
I have resolvedit with this code. Application.ScreenUpdating = False Sheets("TODAY").ListObjects(1).QueryTable.Refresh BackgroundQuery:=False Application.ScreenUpdating = True Am novice, so even if it resolved the problem, am not sure if this...
3 Jan 2021 by OriginalGriff
Compiling does not mean your code is right! :laugh: Think of the development process as writing an email: compiling successfully means that you wrote the email in the right language - English, rather than German for example - not that the email...
25 Dec 2020 by Zaur Bahramov
I have a table containing a some football data, such as Country, League, Teams, Standing table information, such as total matches played, wins, draws, losses, goals scored and conceded, and so on. Here's a file download link: It contains two...
25 Dec 2020 by Zaur Bahramov
Resolved as was suggested elsewere: In order to do this you need a formula in every single field of your 3 tables that link it to data on the Standings tab. That would be 13 x 3 x 20 formulas. Therefore one would try to create formulas that...
25 Dec 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
24 Dec 2020 by Jamracing
Hello.I need help with a program written in Qbasic to check movement of rear suspension of my Formula Vee rear suspension.I have an old program writtten in 1998 or so.it works on front suspension but not the rear i use.The rear suspension is...
24 Dec 2020 by Gerry Schmitz
If the current program does "half the calculations", then run a simulation through the various points in the arc, record them in a table and work from there. I needed to do some things with earth's orbit, so I did 360 calculations (in my...
24 Dec 2020 by OriginalGriff
We really cannot help you. Mostly because we have no idea what the old app looks like, or what maths it may be using - so we are as in the dark as you! And we aren't a "code to order" service - while we are more than willing to help those that...
14 Dec 2020 by mekenix
i solved it by making it like vatprice = txtAmount.Value * (txtOnePrice.Value * txtVAT.Value) this. Thanks everybody
14 Dec 2020 by mekenix
I am trying to create a pre-accounting application on vb and my code is like this. Private Sub txtAmount_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) Dim vatprice As Double Dim price As Double If KeyCode = 13 Then...
14 Dec 2020 by Patrice T
Quote: Can someone please help me? Your code do not behave the way you expect, or you don't understand why ! There is an almost universal solution: Run your code on debugger step by step, inspect variables. The debugger is here to show you what...
14 Dec 2020 by Richard MacCutchan
In logical terms you should have something like this: NetTotal = NumberOfItems * UnitPrice ' e.g. 5 * 8000 VatTotal = NetTotal * (VatRate / 100) ' Assuming VatRate is a percentage number, eg. 8.0, 17.5 etc. GrossTotal = NetTotal + VatTotal ...
14 Dec 2020 by BabyYoda
As mentioned in the comments, you are dividing a number that is already in percentage format by 100.
14 Dec 2020 by Richard Deeming
Your result is correct based on the values and formula provided. Perhaps you meant to enter a VAT rate of 8% instead of 0.08%? vatprice = txtAmount.Value * (txtOnePrice.Value * txtVAT.Value / 100) = 1 * (8000 ...
2 Dec 2020 by Sunil T
I was using MS Office 7 and macro was running faster. However ever since I moved to office 365 64bit, Macro became dead slow to fetch data. I use below code to pull stock data from a site, where I used to pull 150 stock data within 5 to 10 min...
25 Nov 2020 by Richard MacCutchan
OK, after further testing it seems there was still a flaw in my previous solution, for which I apologise. Change your ReadCell method to the following: public string ReadCell(int row, int column) { column += 1; // adjust column to Excel...
25 Nov 2020 by dejf111
Hello everybody. I'd like to copy the value from the cell that lies next to my wanted cell.I would then like to write my copied value in a text document. My individual steps: 1.Open Excel file 2.Find the cells 3.Create new text file 4.Write my...
25 Nov 2020 by CHill60
Unless you are trying to run a VBA macro in the Excel sheet (which is unlikely) then there is a problem with your Excel installation. Uninstall Office on that PC and re-install. Then try again. More or less what was said in the comments to...
24 Nov 2020 by dejf111
Hello everybody. I'd like to copy the value from the cell that lies next to my wanted cell.I would then like to write my copied value in a text document. My individual steps: 1.Open Excel file 2.Find the cells ...
24 Nov 2020 by Richard MacCutchan
Your ReadCell method is incorrect, you have the following: public string ReadCell(int i, int j) { for ( i = 0; i
22 Nov 2020 by oronsultan
Hey guys, I tried to summarize this as much as possible, I am sorry in advance for the length of the text. I need your help in solving a problem we've been trying to deal with for the past few days. So the story is this: we wrote a console application that extracts a large amount of data from a...
20 Nov 2020 by Richard MacCutchan
I have copied your code and with a couple of minor changes it works: using System; using System.IO; using System.Windows.Forms; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { ...
15 Nov 2020 by Member 13197019
Hello, I'm trying to use a Visual Basic windows form app to open microsoft office 2013 Excel. When my program tries to get Excel to open I get the following error. An exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll but was not handled in user code ...
12 Nov 2020 by Richard MacCutchan
This code works for me: Imports Excel = Microsoft.Office.Interop.Excel Public Class Form1 Private Sub ButtonShow_Click(sender As Object, e As EventArgs) Handles ButtonShow.Click Dim CellValue As String Dim filename As String...
12 Nov 2020 by LndM
Dear Code Project Community, I have been searching a lot and didnt find any Solution which worked for me so perhaps someone can give me a hint on my Problem. Id like to show a Cell-Value in a textbox which can be choosen dependend on inputs of...
11 Nov 2020 by Fueled By Decaff
Your xlApp is never getting initialised and is always Nothing, so when you try to use it VB throws a NullReferenceException. Add the line 'xlApp = New Excel.Application()' after the 'Try' to initialise xlApp. NullReferenceException is a very...
6 Nov 2020 by KarstenK
After googling a minute I found this googled solution. I done some excel programming over 20 years ago, but I see that you missed some important steps. It looks like you should spend more time reading and learning at first.