473,320 Members | 1,828 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,320 software developers and data experts.

how to use command button to load excel file from the listfile and then dispay it

hello
for your imformation im using Vb6 and having difficulties on loading a file and then displayed the file. for your information i uses a combox,listview ,directory view and also command buttons for my program.i am having the difficulities on loading the data using my load button and than display the data.if i want to load an excel data and then display the data, how shoule i program it.pls help me.

Private Sub cboPattern_Change()
Dim pos1 As Integer
Dim pos2 As Integer
Dim txt As String

txt = cboPattern.Text
pos1 = InStrRev(txt, "(")
pos2 = InStrRev(txt, ")")
filList.Pattern = Mid$(txt, pos1 + 1, pos2 - pos1 - 1)
End Sub

Private Sub cmdCancel_Click()
Me.Hide
End Sub

Private Sub cmdOk_Click()
' We did not cancel.
Canceled = False
FilePath = filList.Path
FileName = filList.FileName




End Sub


Private Sub dirList_Change()
filList.Path = dirList.Path
End Sub

Private Sub drvList_Change()
'On Error GoTo DriveError
dirList.Path = drvList.Drive
Exit Sub

DriveError:
drvList.Drive = dirList.Path
Exit Sub
End Sub



Private Sub Form_Load()
' Assume we will cancel.
Canceled = True
FileName = ""
FilePath = ""

cboPattern.AddItem "All Files (*.*)"
cboPattern.AddItem "Text Files (*.txt)"
cboPattern.AddItem "Excel Files (*.xls)"
cboPattern.AddItem "Bitmap Files (*.bmp)"
cboPattern.AddItem "VB Files (*.frm;*.frx;*.vbp;*.vbw)"

cboPattern.ListIndex = 0
End Sub
Sep 7 '07 #1
0 1724

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is...
3
by: VbUser25 | last post by:
hi.. i have a form i accept some user inputs in the form. there is a link on the form from where i open the excel file in the same browser (not in a new page...simply using a href. i am also...
2
by: Mr. Bungle | last post by:
When importing excel from access I am fully aware that one can import directly into a table. Can you get as specific via code or something to import data from an excel sheet to a FORM (Not Table)...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
8
by: DC Gringo | last post by:
I have a simple button that should open another window and export a datagrid to an Excel file. I'm getting: "Name 'window' is not declared." What do I need to declare or import? <INPUT...
2
by: Senthil | last post by:
Hi All I need to create an Excel report and create a command button and have to run a macro on the click event that will print all the pages in the Excel workbook. I am able to create the report...
1
by: hanhan | last post by:
Hi all, I need to write a program in VB.Net 2003 for the pocket PC (with mobile 5), which will read data from an Excel file, and dispay them. I didn't succeed to create a correct connection to...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
2
rsmccli
by: rsmccli | last post by:
Hello. Using Access 2002. I have set up a command button on a form that will print off a list of hyperlinked documents that resides in one of our tables. I have been using code borrowed from Graham R...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.