Accessing an Excel data file on the Client side using ASP .NET vbscript

Amit Kumar Chatterjee 0 Reputation points
2025-05-28T19:06:08.3366667+00:00

I have hosted a web-based application using ASP.NET. I am using vbscript in my code. I have an Excel file in my system with some data. I want to write a code that will fetch the data from the Excel and write into a table in SQL Server. Both the database and the web app are hosted in the cloud while the Excel file is in my local system. Can anyone help me with the code?

Developer technologies ASP.NET ASP.NET API
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2025-05-28T21:17:15.1433333+00:00

    you website will need to support the upload of the excel file. then you can use OpenXml sdk to read the the uploaded file.

    https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk

    note: you will need to use vb.net or c# to use the sdk. if you are an old active server pages site, you will need to migrate to asp.net

    0 comments No comments

  2. SurferOnWww 4,631 Reputation points
    2025-05-29T02:44:05.2033333+00:00

    It is not possible for the ASP.NET Web app to obtain the data directly from the Excel file located in user's PC.

    I have an Excel file in my system with some data. I want to write a code that will fetch the data from the Excel and write into a table in SQL Server.

    As one of possible ways to realize the above-mentioned requirement, I suggest the followings:

    (1) develop a desktop app such as Windows Forms which can open the Excel file, read data as required and send the data to the ASP.NET app using HttpClient at the client side, and

    (2) add API in the ASP.NET app which can receive the data sent by the desktop app and save the received data to the database at the server side.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.