473,387 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Loading client Excel file into a form

Hi,

I need to enable the IE user to upload/select a file .Then i have to
validate the data and put it in a grid/table .
Using input type=file will save it on the server where there is no need for
it .

Br
Ornez
Jul 21 '05 #1
1 1475
Dim xlApp As Excel.Application

Dim xlBook As Excel.Workbook

Dim xlSheet1 As Excel.Worksheet

' Start Excel and get Application object.

'xlApp = CreateObject("Excel.Application")

xlApp = New Excel.Application

' Get a new workbook.

xlBook = xlApp.Workbooks.Open(strFile)

xlSheet1 = xlBook.Worksheets(1)

Dim strSheet As String

strSheet = xlSheet1.Name

'close everything

xlSheet1 = Nothing

xlBook.Close()

xlBook = Nothing

xlApp = Nothing

Dim con As New OleDbConnection

con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strFile & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

con.Open()

Dim dtbl As New DataTable

Dim dad As New OleDbDataAdapter("SELECT * FROM [" & strSheet & "$] WHERE
LEN(Number) > 0", con)

Try

dad.Fill(dtbl)

"Ornez" <Or***@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
Hi,

I need to enable the IE user to upload/select a file .Then i have to
validate the data and put it in a grid/table .
Using input type=file will save it on the server where there is no need for it .

Br
Ornez

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jae | last post by:
I'm writing a web application that exports and imports excel files. The application gets a list of users and their info and displays it in a datagrid .The user then selects to save the file as a...
0
by: Ivan K | last post by:
Hi, This is probably more of an Internet Explorer-related problem but I thought I would crosspost to microsoft.public.dotnet.framework.aspnet as this problem has probably occured for other...
3
by: Holmes | last post by:
Hello Ran into a bit of a problem here and have now exhausted my resources to getting this working What I am trying to do is load and show a simple vb form with a listbox in it Dim...
1
by: Ornez | last post by:
Hi, I need to enable the IE user to upload/select a file .Then i have to validate the data and put it in a grid/table . Using input type=file will save it on the server where there is no need...
8
by: Djim | last post by:
Hello, i am starting PHP, and after 2 days of search, i am posting. MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the user can update anything, then it will be automaticly...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
8
by: Johnny | last post by:
Hi all: I have an ASP.NET form that reads an Excel file and populates a datagrid. If I load the form in IE on the server, and select a local file, the code works fine. However if I load the form...
0
by: wankhusairi | last post by:
hallo sir .. i am still new on using vb and i have tried to load an excel using a visual basic interface.. but if i wanted to plot my excel data what should i do.. must i cahnge my program on loading...
1
by: SPJ | last post by:
Sorry, forgot to mention Subject in my earlier post, hence reposting. ------------ I am writing a script which need's to convert an excel file to csv (text) format. For that I am using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.