473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Problems with Excel 2003.

Hi,

I can't find the way to do something from vb .net in current copy of
Excel. All posts which I read tell how to make application.excel object
and do something. I need to write something like addin for eg:

-Excel is activated and some file is loaded
then i'd like lounch my .net program which has some button
when I press the button some text is jot down in
activesheet/activecell.

Please help, how to do this.

Peter.

Dec 7 '05 #1
2 1156
Hi,

here is an example of some code I used in my application to do some input in
an excel worksheet. Comments and values are in Dutch, but this shoudn't be a
problem, I guess...
Private Sub MicrosoftExcelToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MicrosoftExcelToolStripMenuItem.Click

'Declareer de variabelen voor de Excel objecten

Dim exlAppl As Excel.Application

Dim exlWbook As Excel.Workbook

Dim exlWsheet As Excel.Worksheet

'Wijs een waarde toe aan de variabelen

exlAppl = CType(CreateObject("Excel.Application"), Excel.Application)

exlWbook = CType(exlAppl.Workbooks.Add, Excel.Workbook)

exlWsheet = CType(exlWbook.Worksheets(1), Excel.Worksheet)

'Voeg data toe aan het excel werkblad

With exlWsheet

..Columns.ColumnWidth = 11

..Range("A1").Value = "METRISCHE GARENLENGTE OMGEZET NAAR ALLE NUMMERSOORTEN"

With .Range("A1")

..Font.Bold = True

..Font.Size = 12

..Font.Color = 115

End With

..Range("B1").ColumnWidth = 5

..Range("A3").Value = "Metrische lengte ="

..Range("C3").Value = Me.txtMetrLengte.Text

With .Range("E5")

..Value = "GETWIJND"

..Font.Bold = True

..HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter

End With

..Range("C6").Value = "Enkel"

..Range("D6").Value = "2-draad"

..Range("E6").Value = "3-draad"

..Range("F6").Value = "4-draad"

With .Range("C6", "F6")

..Font.Bold = True

..HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter

End With

...........

"kosecki" <pk*******@wp.pl> schreef in bericht
news:11*********************@g44g2000cwa.googlegro ups.com...
Hi,

I can't find the way to do something from vb .net in current copy of
Excel. All posts which I read tell how to make application.excel object
and do something. I need to write something like addin for eg:

-Excel is activated and some file is loaded
then i'd like lounch my .net program which has some button
when I press the button some text is jot down in
activesheet/activecell.

Please help, how to do this.

Peter.

Dec 7 '05 #2
I'know where is the key:

I need to use:

dim myExcekl as Object
myExcel = GetObject(, "Excel.Application")
myActive = myExcel.ActiveSheet
......

Dec 7 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Krmpotic | last post by:
hi!! I use the following code to operate excel document: Excel.Application excelApp = new Excel.ApplicationClass(); //excelApp.Visible = true; string workbookPath = "c:\\eltina.xls";...
1
by: Jan Olof Jonsson | last post by:
Hello. We hawe a problem with the Excel-program on a public webserver. Excel is installated to convert/produce HTML - documents to a website on the server when client users in a webinterface...
0
by: Jeremy B. | last post by:
I am an engineering student new to Visual Basic.Net programming. I am remoting to Excel from a Windows form and I am having some problems when I run my application on a computer that has a different...
3
by: Atley | last post by:
I am trying to create a new spreadsheet in Excel using VB.net 2003. This application has to be useable by a range of users running anywhere from Excel 2000 to Excel XP to Excel 2003. My dev...
2
by: sherifffruitfly | last post by:
Hi, I'm using an adaptation of excel-reading code that's all over the internet - I don't much like or understand it, but it has worked for me in the past.... beggars can't be choosers... : ...
5
by: =?Utf-8?B?U3R1YXJ0?= | last post by:
Hi There I have been having a play around with the following code to display a datagrid in Excel (all from Steve Orr's site): Private Sub btnTechServAccred_Click(ByVal sender As System.Object,...
1
by: =?Utf-8?B?R2xlbm4gR29tZXo=?= | last post by:
Does Office Excel 2000 support XSLT transformation of data from XML cause am having problem when the attachment is opened in the client side if the Excels version is in Office 2000 and also its...
4
by: =?Utf-8?B?THluZXJz?= | last post by:
Hello All, We have a VB.NET application writen using VS 2003. This application apens an excel file from a vendor, reads the data and performs whatever functions it needs. We recently upgraded our...
1
by: SeeMe | last post by:
Hi, I using Microsoft Visual Studio C# 2003, Microsoft Office Excel 2003 and using IIS server. I added Microsoft Excel 11.0 Object Library refrence. 1. Software not allow me to write this code:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.