Avatar of MariaHalt
MariaHaltFlag for United States of America

asked on 

Required dll files for creating Excel files

What dll files are required to run a VB6 program that creates an Excel file on a W2K machine?  Excel is NOT loaded on the machine.  

FYI, this is how I'm creating the Excel file:

Dim xclApplication As Excel.Application
Dim xclWorkbook As Excel.Workbook
Dim xclWorksheet As Excel.Worksheet

Set xclWorksheet = xclWorkbook.Sheets("Sheet1")

 xclWorksheet.Range("A2").CopyFromRecordset <recordset object>
   
 xclWorksheet.Range("A1").Value = "Field 1"
 xclWorksheet.Range("B1").Value = "Field 2"
 xclWorksheet.Range("C1").Value = "Field 3"
       
Set xclWorksheet = Nothing
xclWorkbook.SaveAs <filename>
xclApplication.Quit
Set xclWorkbook = Nothing
Set xclApplication = Nothing
Visual Basic ClassicMicrosoft Excel

Avatar of undefined
Last Comment
MariaHalt
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

For starters you'll need the Microsoft Excel (whatever version) Object Model (*.olb)
That's it I believe.
Not sure if that file has any dependant files you'll need too.
ASKER CERTIFIED SOLUTION
Avatar of JohnBPrice
JohnBPrice

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

{potentlally obvious comment}
Exactly what is the purpose of creating an Excel file on a pc that does not have Excel loaded?
Avatar of JohnBPrice
JohnBPrice

To give it to someone else.  I've had to do it before.  Once I had to build a website where the user could download a dynamically built Excel workbook, but no Excel on the web server.  I hacked it up in XML, filled in the data, told ASP to tell the browser it was Excel, and TADA!, you are downloading brand new Excel workbook with no Excel involved (well not on the web server, the user may have, or may have had the free viewer).

I also have serveral automated apps that email Excel workbooks to everyone and their uncle, though in those cases I could really use Excel so I did.
Avatar of MariaHalt
MariaHalt
Flag of United States of America image

ASKER

jimhorn -> To answer your questions, EXCEL9.olb is referenced and on the machine & the Excel file is supposed to be emailed out.  Since the recipients have Excel, I thought I could just create the file by referencing the required dlls without having to install Exce (but I can install Excel too if need be).  
Avatar of MariaHalt
MariaHalt
Flag of United States of America image

ASKER

I installed Excel and all is well now.
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo