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!

Help With Type Error Message on Open Excel Sheet

Status
Not open for further replies.

DIVINEDAR0956

IS-IT--Management
Aug 15, 2002
95
0
0
US
I have the following procedure to open an excel sheet from Access. I am getting a Type Error Message when the sheet opens. I can't figure out why please help.

Private Sub Excel_New_File()
Dim xlApp As Object
Dim xlWB As WORKBOOK
Set xlApp = CreateObject("Excel.Application")
xlApp.AskToUpdateLinks = False
xlApp.DisplayAlerts = False
xlApp.Visible = True

Set xlWB = xlApp.Workbooks.Open("C:\WBS_Excel50.xls", False)
xlWB.Sheets("Sheet1").Select
xlApp.AskToUpdateLinks = True
xlApp.DisplayAlerts = True
Set xlApp = Nothing
End Sub

I am getting the message on this line:
Set xlWB = xlApp.Workbooks.Open("C:\WBS_Excel50.xls", False)

Thank you[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top