Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / December 2004



Tip: Looking for answers? Try searching our database.

excel to open in vb

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kiran - 29 Dec 2004 10:17 GMT
Hi All,
Can any one help me to writhe a code in VB so that by clicking command
button I should get all the excel files displayed and if I click the selected
excel file it should open
TIA
Morgan - 29 Dec 2004 11:41 GMT
'This example requires the following controls on a form:
' - CommandButton  (name=Command1)
' - A Common Dialog Box (CommonDialog1)
Option Explicit

 Private Declare Function ShellExecute Lib "shell32.dll" Alias _
                "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As
String, _
                ByVal lpFile As String, ByVal lpParameters As String, _
                ByVal lpDirectory As String, ByVal nShowCmd As Long) As
Long

Private Sub Command1_Click()
   Dim RetVal
   CommonDialog1.FileName = ""
   CommonDialog1.Filter = "Microsoft Excel (*.xls))|*.xls"
   CommonDialog1.ShowOpen
   RetVal = ShellExecute(Me.hwnd, "Open", CommonDialog1.FileName, "", "",
1)
End Sub

Signature

Saludos ... Miguel Angel Martínez Morgan ... 8-)

> Hi All,
> Can any one help me to writhe a code in VB so that by clicking command
> button I should get all the excel files displayed and if I click the
> selected excel file it should open
> TIA
kiran - 29 Dec 2004 12:05 GMT
thanks

> 'This example requires the following controls on a form:
> ' - CommandButton  (name=Command1)
[quoted text clipped - 22 lines]
> > selected excel file it should open
> > TIA
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.