Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2003, 07:26 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old June 6th, 2003, 08:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

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



Gonzalo Bianchi
 
Old June 6th, 2003, 09:41 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old June 6th, 2003, 11:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

try this link...

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

it has all you need...

Gonzalo Bianchi
 
Old June 8th, 2003, 09:42 PM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old June 9th, 2003, 03:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
 
Old June 9th, 2003, 09:56 AM
n/a
Guest
 
Posts: n/a
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't have Office Access flashmanTom BOOK: Beginning VB.NET Databases 1 May 13th, 2008 04:10 AM
Excel VBA and Office Clipboard tcarnahan Excel VBA 3 April 4th, 2006 11:41 AM
uploading ms excel without office on server vauneen Classic ASP Components 0 April 13th, 2005 09:16 AM
Out of Office patriciacardoza BOOK: Access 2003 VBA Programmer's Reference 1 August 25th, 2004 04:25 PM
Is this Office Automation with COM? Aaron Edwards ASP.NET 1.0 and 1.1 Basics 1 July 9th, 2004 02:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.