Message 1 of 2
Excel Open Dialogue Box

Not applicable
03-11-2009
09:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi, All
I have seen that below is a routine which is used to open a sepecific file from Excel but i want in a different way like i do not the file name and i want the same open dialogue box to open and select a desired file.
can any one tell me how.
thanks
Dim Excelobj As Excel.Application
Dim wbkobj As Workbook
Dim shtobj As Worksheet
On Error Resume Next
UserForm1.Hide
Err.Clear
Set Excelobj = GetObject(, "Excel.Application")
If Err 0 Then
MsgBox "couldnot start excel", vbExclamation
End
End If
End If
Excelobj.Visible = True
Set wbkobj = workbooks.Open(FileName:="C:\Dwg\REGISTER.xls")
Set shtobj = Exceobj.worksheets(1)
UserForm1.Show
End Sub
I have seen that below is a routine which is used to open a sepecific file from Excel but i want in a different way like i do not the file name and i want the same open dialogue box to open and select a desired file.
can any one tell me how.
thanks
Dim Excelobj As Excel.Application
Dim wbkobj As Workbook
Dim shtobj As Worksheet
On Error Resume Next
UserForm1.Hide
Err.Clear
Set Excelobj = GetObject(, "Excel.Application")
If Err 0 Then
MsgBox "couldnot start excel", vbExclamation
End
End If
End If
Excelobj.Visible = True
Set wbkobj = workbooks.Open(FileName:="C:\Dwg\REGISTER.xls")
Set shtobj = Exceobj.worksheets(1)
UserForm1.Show
End Sub