Writing To A Excel File 
Author Message
 Writing To A Excel File

Hello,

  I want to write to an Excel File in Visual Basic.  Can anyone help??
I know how to write to an Access File but I haven't had any luck
writing to an Excel File.

Thanks
--
Posted via Talkway - http://www.*-*-*.com/
Exchange ideas on practically anything (tm).



Sun, 24 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
Writing to an Excel file directly can only be done at a very low level, and
I assure you that it is not something the VB programmer want's to get
involved in. The best soution is to use Excel's automation features. This
will require that Excel be installed on the application machine.



Quote:
> Hello,

>   I want to write to an Excel File in Visual Basic.  Can anyone help??
> I know how to write to an Access File but I haven't had any luck
> writing to an Excel File.

> Thanks
> --
> Posted via Talkway - http://www.talkway.com
> Exchange ideas on practically anything (tm).



Sun, 24 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
So you can write to an Access File in Visual Basic but you can not
write to an existing Excel File in Visual Basic?  Do I have that
correct?

Thanks
--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).



Sun, 24 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
I thought the idea of having a reference to Excel's 8.0 object library in a
project was to be able to use the Excel objects and their properties in your
program with no need to have Excel on you computer.

Since I have only played with accessing Excel from VB to see how it was done
and since all my computers have Excel on them, I can't be sure of this, but
why should you have to have Excel on you computer to access excel files any
more than you need to have Access on your computer to access Access files?


Quote:
> Writing to an Excel file directly can only be done at a very low level,
and
> I assure you that it is not something the VB programmer want's to get
> involved in. The best soution is to use Excel's automation features. This
> will require that Excel be installed on the application machine.



Mon, 25 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
I can tell you for a fact that writing to an Excel file does not have
to be done at "a very low level".  Unless the reference is in the
actual creation of an Excel file.  I have been working on a VB program
that can write to an existing Excel file.  It populates Excel cells
with data from an Access database or can clean the cells out.  The
code is actually fairly simple.  It has been tested on a system that
does not have Excel and it worked fine.

Now as far as creating an Excel file from scratch.  That may or may
not be another story.

On Thu, 07 Oct 1999 03:06:36 GMT, "William F. LaMartin"

Quote:

>I thought the idea of having a reference to Excel's 8.0 object library in a
>project was to be able to use the Excel objects and their properties in your
>program with no need to have Excel on you computer.

>Since I have only played with accessing Excel from VB to see how it was done
>and since all my computers have Excel on them, I can't be sure of this, but
>why should you have to have Excel on you computer to access excel files any
>more than you need to have Access on your computer to access Access files?



>> Writing to an Excel file directly can only be done at a very low level,
>and
>> I assure you that it is not something the VB programmer want's to get
>> involved in. The best soution is to use Excel's automation features. This
>> will require that Excel be installed on the application machine.

Remove zzz from my email address:

~~~Golf Tip:  Don't pick up a lost ball until it stops rolling~~~o


Home Page - http://www.castlegate.net/personals/kdavis
Standard Disclaimer    (Win95 Tips, sound bites, and more!)



Mon, 25 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
Kevin,

  That is exactly what I am trying to do is write to a cell in an
existing Excel File.  Can you supply any sample code on how to do
this?  I know how to work with Access files but do not know how to
write to an existing Excel File.

Thanks

Tim
--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).



Mon, 25 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
Add a project reference to the MS Excel Object Library. Here's some skeleton
code.

    Dim xla As Excel.Application
    Dim xlb As Excel.Workbook
    Dim xls As Excel.Worksheet

    Set xla = New Excel.Application
    Set xlb = xla.Workbooks.Open("D:\Toy.xls")
    Set xls = xlb.Sheets("Sheet1")

    With xls
        .Cells(1, 1).Value = "Cell R1C1"
    End With

    Set xls = Nothing
    xlb.Close True
    Set xlb = Nothing
    xla.Quit
    Set xla = Nothing

Peter


Quote:

>   That is exactly what I am trying to do is write to a cell in an
> existing Excel File.  Can you supply any sample code on how to do
> this?  I know how to work with Access files but do not know how to
> write to an existing Excel File.

> Tim



Mon, 25 Mar 2002 03:00:00 GMT  
 Writing To A Excel File
Add a project reference to the MS Excel Object Library. Here's some skeleton
code.

    Dim xla As Excel.Application
    Dim xlb As Excel.Workbook
    Dim xls As Excel.Worksheet

    Set xla = New Excel.Application
    Set xlb = xla.Workbooks.Open("D:\Toy.xls")
    Set xls = xlb.Sheets("Sheet1")

    With xls
        .Cells(1, 1).Value = "Cell R1C1"
    End With

    Set xls = Nothing
    xlb.Close True
    Set xlb = Nothing
    xla.Quit
    Set xla = Nothing

Peter


Quote:

>   That is exactly what I am trying to do is write to a cell in an
> existing Excel File.  Can you supply any sample code on how to do
> this?  I know how to work with Access files but do not know how to
> write to an existing Excel File.

> Tim



Mon, 25 Mar 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Write to an Excel file from VB without Excel present

2. Can QBasic write and read Excel files?

3. Writing to an Excel file

4. Writing to a Excel file

5. Write and SaveAs Excel files

6. From an ASP page, is there a way write to an EXCEL file without having EXCEL installed on the IIS machine ?

7. How do I create and write to an excel file from ASP?

8. Write a Excel File Without Excel App

9. Writing Excel Files W/O Existing Excel Application

10. Writing Excel-files w/o Excel present?

11. ANNOUNCE : Platform independent toolkit for writing excel file format files

12. Can QBasic write to Excel files?

 

 
Powered by phpBB® Forum Software