p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB How-To (http://p2p.wrox.com/forumdisplay.php?f=78)
-   -   Excel but no Office (http://p2p.wrox.com/showthread.php?t=222)

walgie June 6th, 2003 07:26 AM

Excel but no Office
 
I'm fairly new to VB, so please bear with me on this.
I have written a VB6 batch job that reads a Sql Server table and creates an Excel spreadsheet.
It works great on my desktop, but as soon as I move it down to a W2k server, it abends with a "Activex component can't create object" message.
The obvious is the W2K server does not have Office installed.

This leads to my question:

Is it possible to create an Excel spreadsheet from VB when MS Office has not been installed?


William R. Algie

gbianchi June 6th, 2003 08:59 AM

yes.. but you have to include the excel object in the installer of your program..
it's weight about 8 meg.



Gonzalo Bianchi

walgie June 6th, 2003 09:41 AM

Hi gbianchi;

Is the Excel object that you speak of in the Office folder where I find Excel.exe.

I have created an install package that contains Excel.exe and Excel8.olb and still get the Activex message.

The code that gives the message is;

    Dim fso As scripting.FileSystemObject
    Dim hHeading As String
    Dim X As Integer

    Set oXL = CreateObject("Excel.Application")
    Set oXL.Workbooks.Add
    oWB.Sheets(1).Name = "Report_Extract"

    MsgBox ("Excel Version: " & oXL.Version)


Could you give me a little more information on how I go about using the Excel object.

Thanks

William R. Algie

gbianchi June 6th, 2003 11:11 AM

try this link...

http://msdn.microsoft.com/library/de...tml/offaut.asp

it has all you need...

Gonzalo Bianchi

NiMot June 8th, 2003 09:42 PM

Walgie,

I have an app that uses Access and fails on boxes without Access installed. I haven't read the 123 page article gbianchi pointed you to, but I did come across this page, http://support.microsoft.com/support.../q208/7/30.asp near it. It sounds like you have to pony up $799 for the Developers version of Office to re-distribute the run-time files. If I'm wrong and there is a free solution, please let me know.

Nick

pgtips June 9th, 2003 03:39 AM

There is an Excel ODBC driver you can use instead. It just treats the spreadsheets like db tables so you can add stuff using the normal SQL syntax of CREATE TABLE, INSERT etc. I don't have any links to hand, but a search for 'Excel ODBC driver' should get you started.

n/a June 9th, 2003 09:56 AM

If the app is written in vb and uses the access engine, just install mdac from microsoft and the jet service packs. The station does not have to have access installed to run a vb program.


All times are GMT -4. The time now is 10:36 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.