LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
jat jat is offline
external usenet poster
 
Posts: 33
Default Workbooks.open method fails

Hi,

I am trying to open an Excel spreadsheet from Access using the following
code in Access:

Private mobjXL As Excel.Application

Private Sub cmdImportFiles_Click()
Dim wrk As Excel.Workbook
Set mobjXL = New Excel.Application
With mobjXL
.ScreenUpdating = False
.Visible = false
.DisplayAlerts = False
Set wrk = mobjXL.Workbooks.Open("Excel file path and name")
' Do something with the Excel spreadsheet
End With
' error handler
End Sub

I keep getting an error message of 'Method 'Open' of object Workbook failed'
everytime Excel tries to open the spreadsheet (and it can be any
spreadsheet). Any suggestions on how to open the Excel spreadsheet in VBA
without the error message?

Regards
Justin
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Web Components: No Open Method of Workbooks? Karl Yates Excel Programming 1 December 18th 04 01:45 AM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
troubles with the Workbooks.Open method in Excel 97 Amarth Excel Programming 1 June 14th 04 02:02 PM
Open method of workbooks fails when Excel is hosted in IE [email protected] Excel Programming 5 January 30th 04 02:19 AM
Workbooks.Open fails after upgrade to XL2000 from XL97 Dan Merchant Excel Programming 0 July 9th 03 11:03 PM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"