?
Solved

Writing an Excel file without opening Excel?

Posted on 2003-02-21
8
Medium Priority
?
180 Views
Last Modified: 2010-04-07
Can anyone tell me if there is a way to write or create an excel file without actually opening excel?

Thanks
Jason
0
Comment
Question by:JasonNullWal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 7995088
make a reference to MS Excel object library under project/references:

Dim xlApp as New Excel.Application
Dim xlWkBk as Excel.Workbook

set xlWkBk = xlApp.WorkBooks.add

'' do what you want w/ xlWkBk

xlWkBk.saveAs "<Path to xls>"
xlWkBk.close
set xlWkBk = nothing

xlApp.quit
set xlApp = Nothing
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7995109
if you really don't want to open Excel, your best workaround is to generate a CSV file which is recognize natively by Excel
0
 

Author Comment

by:JasonNullWal
ID: 7995637
Could you please tell me more about how i would generate a CSV file.  One capability i would like the program to have is to create an excel file on a computer that does not have excel installed.  So that would rule out creating a reference to Excel since the library would not be available.  Is this possible with creating a CSV file?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Accepted Solution

by:
keenez earned 100 total points
ID: 7995747
CSV is good for text only.  Commas delimit information in the file ....

Eg.

John Doe, 555-555-555, 55 Somewhere street
Jane Doe, 555-555-556, 66 Somewhere street

etc ....

Excel knows how to handle these files when they have a '.csv' extension.

To save something as a "true" native Excel file (with graphs, etc ....) without Excel will probably require a 3rd party tool and dll which will have to be installed with your application.  (Unless of course you want to write your own dll that can write to Excel format ..... which is what you're trying not to do).

Cheers,

keenez
0
 

Author Comment

by:JasonNullWal
ID: 7995900
I'm not using any graphs but i do have output being written to multiple sheets within the Excel project.  Right now the program writes to a text file if excel is not installed.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7999016
Multiple sheets are not supported by CSV. It is only a text file. You definitely need to install Excel to do what you want.
0
 

Expert Comment

by:CleanupPing
ID: 8901302
JasonNullWal:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8964083
Moderator, my recommended disposition is:

    Accept keenez's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question