Solved

Open dialog box in vb.net 2005 with all extentions of excel

Posted on 2011-03-16
2
787 Views
Last Modified: 2012-05-11
Hi,

I have a code to open specific excel extentions.How can I open all extentions of excel.


 o.Title = "Select the file to open"
            'Excel 2007 Log 8321:

 Dim o As New OpenFileDialog()
            o.Filter = "Excel Spreadsheets (*.xls)|*.xls|Excel Spreadsheets (*.xlsx)|*.xlsx" ---Need to change here to display all excel extentions
            If o.ShowDialog = Windows.Forms.DialogResult.OK Then
               If o.FileName <> String.Empty Then
                  myFiles = Split(o.FileName, vbNullChar)

                  txtInputFile.Text = (myFiles(0))
               End If
            End If


Any suggestions appreciated.

Cheers
0
Comment
Question by:RIAS
  • 2
2 Comments
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35146173
Hi,

Use this line:
"Excel Spreadsheets (*.xls;*.xlsx)|*.xls;*.xlsx"

Asim
0
 
LVL 10

Accepted Solution

by:
Asim Nazir earned 500 total points
ID: 35146184
Code will become:

 
Dim o As New OpenFileDialog()
        o.Filter = "Excel Spreadsheets (*.xls;*.xlsx)|*.xls;*.xlsx"
        If o.ShowDialog = Windows.Forms.DialogResult.OK Then
            If o.FileName <> String.Empty Then
                myFiles = Split(o.FileName, vbNullChar)

                txtInputFile.Text = (myFiles(0))
            End If

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# guarantee sql connection close 6 41
How to join on ID, with prefix? 15 60
C# bracket error 3 32
vb.net class 3 17
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question