Real Software Forums
http://forums.realsoftware.com/

Dim excel as New ExcelApplication crashes on Windows7
http://forums.realsoftware.com/viewtopic.php?f=6&t=45431
Page 1 of 1

Author:  pasko [ Mon Sep 24, 2012 5:01 pm ]
Post subject:  Dim excel as New ExcelApplication crashes on Windows7

My app that runs just fine on Vista crashes at the statement:

Dim excel as New ExcelApplication

on my new laptop running Windows7

Is there anything specific that I need to have for Windows7?

Thank you
Pasko

Author:  timhare [ Mon Sep 24, 2012 5:23 pm ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

Do you have Excel installed?

Author:  eugenedakin [ Mon Sep 24, 2012 8:54 pm ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

Hello Pasko,

I tried the following code on my Windows 7, Excel 2010, Real Studio 2012 r1 system, and it worked well.

Dim excel as new ExcelApplication  //create a new object
excel.visible = true //show the excel application
excel.workbooks.add //add a workbook to the application

excel.Range("A1").value = "Gallons" //Place text in the cell

excel = Nil // Set the object to Nil

Exception err as OLEException //Check for Errors
MsgBox str(err) //Display the Error


Could you give this a try? What versions of Windows, Office, and Real Studio are you running?

Sincerely,

Eugene

Author:  pasko [ Tue Sep 25, 2012 11:09 am ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

I found out that the VBA was messed up on my machine. Duh! Which brings me to the next thought or question, I should say: will the RB executable run on machines with no Office or VBA? I have no way to test it because I am not allowed to remove Office, as you might have guessed it.
Thank you
Pasko

Author:  npalardy [ Tue Sep 25, 2012 11:44 am ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

pasko wrote:
I found out that the VBA was messed up on my machine. Duh! Which brings me to the next thought or question, I should say: will the RB executable run on machines with no Office or VBA? I have no way to test it because I am not allowed to remove Office, as you might have guessed it.
Thank you
Pasko


No
Without Office the required OLE objects & libraries will not be present

Author:  pasko [ Tue Sep 25, 2012 12:37 pm ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

Do you know of a place where these libraries can be downloaded from?

Author:  npalardy [ Tue Sep 25, 2012 2:32 pm ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

pasko wrote:
Do you know of a place where these libraries can be downloaded from?

No - they need to be installed & registered properly which is taken care of when Office is installed.

Author:  timhare [ Tue Sep 25, 2012 3:06 pm ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

They wouldn't work without Office anyway.

Author:  eugenedakin [ Tue Sep 25, 2012 8:43 pm ]
Post subject:  Re: Dim excel as New ExcelApplication crashes on Windows7

Hello Pasko,

Windows offers a free Excel viewer that can be downloaded here: http://support.microsoft.com/kb/913879. Installing this program should install and register all of the libraries needed for Excel to run on Windows.

The last time that I installed the Windows 7 OS, the code from my book worked with the viewer. The updated version of Excel may have changed but it worked at the time. I have written a book on programming Excel in Windows. You can view the Table of Contents for the Excel book here: http://scispec.ca/Realbasic/Publish/Publish.htm

I hope this helps,

Eugene
I Wish I Knew How To... Program Excel 2010 with REALStudio in Windows
I Wish I Knew How To... Program Access 2010 with REALStudio Desktop Apps in Windows
I Wish I Knew How To... Program Word 2010 with REALStudio in Windows

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/