473,320 Members | 1,865 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,320 software developers and data experts.

Oggetto Application di excel in vb net 2003

Scusate ma sono da poco passato a scrivere qualche riga di codice in vb.net
2003

ma non sono stato in grado di ritradurre la riga sulla selection sort e
continua a darmi errore

sull'oggetto application qualcuno è in grado di aiutarmi ?

C'è forse qualche altra istruzione da utilizzare ?

Ringrazio in anticipo per l'interessamento

Dim excelApp As New Excel.Application

Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add

Dim excelWorksheet As Excel.Worksheet = _

CType(excelBook.Worksheets(1), Excel.Worksheet)

With excelWorksheet

.Columns("A:H").Select()

.selection.Sort(Key1:=.Range("C2"), Order1:=.xlAscending,
Header:=.xlYes, _

OrderCustom:=1, MatchCase:=False, Orientation:=.xlTopToBottom, _

DataOption1:=.xlSortNormal)

end with
Jan 5 '06 #1
1 2907
Sembra funzione per me - ma se uso i numeri invece delle enums per gli
constants, per essempio:

.Columns("A:H").Sort(Key1:=.Range("C2"), _
Order1:=1, _
Header:=1, OrderCustom:=1, _
MatchCase:=False, _
Orientation:=1, _
DataOption1:=0)

'xlAscending = 1
'xlYes = 1
'xlTopToBottom = 1
'xlSortNormal = 0

Anche io ho fatto senza il 'select, i.e direttamente sulla rige.

HTH

Perdona il mio italiano.

Pierre wrote:
Scusate ma sono da poco passato a scrivere qualche riga di codice in vb.net
2003

ma non sono stato in grado di ritradurre la riga sulla selection sort e
continua a darmi errore

sull'oggetto application qualcuno è in grado di aiutarmi ?

C'è forse qualche altra istruzione da utilizzare ?

Ringrazio in anticipo per l'interessamento

Dim excelApp As New Excel.Application

Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add

Dim excelWorksheet As Excel.Worksheet = _

CType(excelBook.Worksheets(1), Excel.Worksheet)

With excelWorksheet

.Columns("A:H").Select()

.selection.Sort(Key1:=.Range("C2"), Order1:=.xlAscending,
Header:=.xlYes, _

OrderCustom:=1, MatchCase:=False, Orientation:=.xlTopToBottom, _

DataOption1:=.xlSortNormal)

end with

Jan 5 '06 #2

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

Similar topics

1
by: jinu | last post by:
hello, I need to run a vb.net application in different OSs like windows 2003, windows 2000, windows 98 etc.... where only windows 2003 have built-in .net framework and to be installed in...
1
by: Bernd Muent | last post by:
Hi together, I am using the following code in Visual Basic to open Word or Excel applications: Word: Dim w As Word.Application w = CType(CreateObject("Word.application"), Word.Application)...
5
by: Jason | last post by:
I am having some trouble manipulating Excel files. Currently I am trying to create and then close an Excel file/application with the following code. It works fine, except it leaves an EXCEL...
0
by: T-Mat | last post by:
Ciao a tutti!!!! Devo creare un'oggetto riutilizzabile che abbia le funzioni di modifica,aggiunta,eliminazione e scrittura di elementi in un file XML utilizzando il linguaggio C#. Una volta...
2
by: T-Mat | last post by:
Ciao a tutti!!!! Devo creare un'oggetto riutilizzabile che abbia le funzioni di modifica,aggiunta,eliminazione e scrittura di elementi in un file XML utilizzando il linguaggio C#. Una volta...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
4
by: snare88 | last post by:
I have a question regarding a VB.NET 2003 application which was built on a Windows XP machine with Office 2002 installed. The software does some interfacing with Microsoft Excel. I now want to...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
2
by: Gilbert Tordeur | last post by:
Hello, My Web application in VB2008 with IIS calls Excel (2003) to create an Excel file xls. I use therefore Microsoft.Office.Interop.Excel, version 11. This application does not use anonymous...
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...
1
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: 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)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.