LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Problem opening Excel spreadsheeet

I'm running VS 2005, Office 2003 tools and Office 2003 on Vista.
I'm having a problem opening an Excel 2003 spreadsheet using the following
code:
'try to open the spreadsheet
Try
oXL = CreateObject("Excel.Application")
oXL.Visible = True
oWB = oXL.Workbooks.Open("c:\Trash\GL Events (3004 items).XLS")
indExcel = True
Catch myException As Exception
'If cannot connect to spreadsheet, then show error
MsgBox("Access to Spreadsheet failed.", MsgBoxStyle.Exclamation,
myException.Message)
indExcel = False
GoTo Close
End Try

Excel starts and the spreadshet loads and then I get an error: Unable to
cast COM object of type Microsoft.Office.Interop.Excel.Workbookclass.

I haven't touched any programming for the last 3 years so I am deficient.
If some one can help me, I would appreciate it.

I was thinking that the fact that Office 2007 had previously been installed
on this PC might be the problem. From my research I can see that the two
together is a no no and that Office 2007 un-install may not be cleaning up
after itself enough. could this be the problem?
--
Bettie
 
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
Problem opening Excel gb4 Excel Discussion (Misc queries) 0 April 10th 08 09:11 PM
Excel spreadsheeet Catherine Excel Programming 3 January 16th 08 03:34 PM
Problem opening Excel AndrewCrisp Excel Discussion (Misc queries) 1 July 29th 06 07:53 PM
In Excel spreadsheeet the dates change to the wrong date after we. ziptozipper Excel Discussion (Misc queries) 1 February 2nd 05 02:22 PM
excel VBA problem - setting workbook as variable & opening/re-opening safe Excel Programming 1 August 20th 04 12:22 AM


All times are GMT +1. The time now is 03:21 AM.

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

About Us

"It's about Microsoft Excel"