Excel automation

A

a.theil

Please help!

I need a simple excel automation, just 2 write some files into excel.
I do:

Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range

oXL = CreateObject("Excel.Application")
oXL.Visible = True
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
oSheet.Cells(1, 1).value = "Test"

and it says there is no method workbook.add

I couldn´t add the reference microsoft excel object 10.0 because
studio says already added, so I added 5.0 which worked. Also in the
5.0 object explorer there is worksheets.add. So wth does studio need
more?

help very appreciated

regards, Jerry
 
A

a.theil

Hello.

I can´t get along with this application. How do I include this into a
simple vb form sub (e.g. onbutton)?! Where should I insert using or
whatever? The "help" has as much as no examples... at least not to be
found at ease with my english. Why can´t help files just include FULL
simple examples ?!

Any vb-native suggestions? Why does my set disappear in
set oWB = oXL.Workbooks.Add
and why can add be not known (just gettype()) ?!

tia, Jerry
 
J

Jan

Jerry,

Before you start using Excel automation from your .NET app, you should
be aware of same drawbacks. See
http://www.gemboxsoftware.com/ExcelLite.htm#Automation (left column).
If amount of data you are exporting is not large (less than 5 sheets
and 150 rows per sheet), you have our ExcelLite Free component you can
freely use in commercial apps. If your worksheet grows in size, you can
easily update to ExcelLite Professional.

If you still want to use automation, download TaskVision source code
(http://www.windowsforms.net/taskvision). You have excel export there
(among other things).

Jan
 
A

a.theil

Thnx Jan,

I´ll try it with this component. I need just a "lite" application.

Anyway, i´d like better 2 use the native automation. I don´t
understand why my vb.net can´t include the 10.0 reference... (XP Pro,
Office XP, Visual Studio.net 2003 Pro)...

Jerry
 
S

scorpion53061

I encourage you to contact someone for your automation needs in programs
you build. Not everyone can be master of everything. Contracting it out
is not always the best option but it is better than letting the entire
application sink.

Kelly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top