Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

browse select open the excel file

Status
Not open for further replies.

indswamy

Programmer
Jan 7, 2009
16
US
i am trying to browse select open the file
i have error in appExcel line object value set to nothing.
could you help me

Set appExcel = CreateObject("Excel.Application")
appExcel = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file")


If appExcel Is Nothing Then
MsgBox ("Could not open Excel.")
Exit Sub
End If

appExcel.DisplayAlerts=false
 


Hi,
Code:
  Dim appExcel as object, sName, xlWkbk as Object
  Set appExcel = CreateObject("Excel.Application")
  sName = appExcel.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file")
All that GetOpenFilename does is get a STRING that is the name of a workbook.

So then...
Code:
if sName <> False then
  set xlWkbk = appExcel.Workbooks.Open(sName)
end if



Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top