Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Vb.net and Office 2003.

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vb.net and Office 2003.

I don't use VB, but if you open excel,
then hit alt-f11 to get to the VBE
then hit ctrl-g to see the immediate window

You can type:
?xldelimited
and see that it's equal to 1.

And
?xldoublequote
is also 1

Then you can use the numbers instead of using the xl constants.


==
But you could use a reference to:
Microsoft Excel xx.x Object Library



Miguel Arenas wrote:

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Vb.net and Office 2003.

Thanks you.
What you think about array?

"Dave Peterson" wrote:

I don't use VB, but if you open excel,
then hit alt-f11 to get to the VBE
then hit ctrl-g to see the immediate window

You can type:
?xldelimited
and see that it's equal to 1.

And
?xldoublequote
is also 1

Then you can use the numbers instead of using the xl constants.


==
But you could use a reference to:
Microsoft Excel xx.x Object Library



Miguel Arenas wrote:

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vb.net and Office 2003.

I don't speak VB6, but I'm kind of amazed that it doesn't know about arrays.

Are you sure that portion caused a problem?

Miguel Arenas wrote:

Thanks you.
What you think about array?

"Dave Peterson" wrote:

I don't use VB, but if you open excel,
then hit alt-f11 to get to the VBE
then hit ctrl-g to see the immediate window

You can type:
?xldelimited
and see that it's equal to 1.

And
?xldoublequote
is also 1

Then you can use the numbers instead of using the xl constants.


==
But you could use a reference to:
Microsoft Excel xx.x Object Library



Miguel Arenas wrote:

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Vb.net and Office 2003.

The Array is used in VBA. The problem is Miguel is trying to use VBA from
the VB.Net environment. Which won't work. So Miguel, you can use 1 for the
missing constant (xlDelimited). However, this does not solve the Array. I
believe you can't just declare a VB.Net array and pass it to Excel, since it
is expecting a Variant type.
You will probably have to do a little research on passing arrays to Excel.
Good Luck,
Mark

"Dave Peterson" wrote:

I don't speak VB6, but I'm kind of amazed that it doesn't know about arrays.

Are you sure that portion caused a problem?

Miguel Arenas wrote:

Thanks you.
What you think about array?

"Dave Peterson" wrote:

I don't use VB, but if you open excel,
then hit alt-f11 to get to the VBE
then hit ctrl-g to see the immediate window

You can type:
?xldelimited
and see that it's equal to 1.

And
?xldoublequote
is also 1

Then you can use the numbers instead of using the xl constants.


==
But you could use a reference to:
Microsoft Excel xx.x Object Library



Miguel Arenas wrote:

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vb.net and Office 2003.

I understand that the array is used in VBA. I was commenting that I was amazed
that arrays aren't supported by VB.net (I misspoke when I wrote VB6.)

But as an alternative, maybe Miguel can create a workbook that contains a macro
that opens the text file. Then open that workbook and call that macro.

Having still never used VB6 or VB.Net, I have no idea if this is possible,
though.

MarkTheNuke wrote:

The Array is used in VBA. The problem is Miguel is trying to use VBA from
the VB.Net environment. Which won't work. So Miguel, you can use 1 for the
missing constant (xlDelimited). However, this does not solve the Array. I
believe you can't just declare a VB.Net array and pass it to Excel, since it
is expecting a Variant type.
You will probably have to do a little research on passing arrays to Excel.
Good Luck,
Mark

"Dave Peterson" wrote:

I don't speak VB6, but I'm kind of amazed that it doesn't know about arrays.

Are you sure that portion caused a problem?

Miguel Arenas wrote:

Thanks you.
What you think about array?

"Dave Peterson" wrote:

I don't use VB, but if you open excel,
then hit alt-f11 to get to the VBE
then hit ctrl-g to see the immediate window

You can type:
?xldelimited
and see that it's equal to 1.

And
?xldoublequote
is also 1

Then you can use the numbers instead of using the xl constants.


==
But you could use a reference to:
Microsoft Excel xx.x Object Library



Miguel Arenas wrote:

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vb.net and Office 2003.

I still don't know anything about vb.net, but I searched google for "vb.net
array". This was the first hit.

http://www.vb-helper.com/howto_net_d...y_objects.html

Maybe it'll help the OP.

Dave Peterson wrote:

I understand that the array is used in VBA. I was commenting that I was amazed
that arrays aren't supported by VB.net (I misspoke when I wrote VB6.)

But as an alternative, maybe Miguel can create a workbook that contains a macro
that opens the text file. Then open that workbook and call that macro.

Having still never used VB6 or VB.Net, I have no idea if this is possible,
though.

MarkTheNuke wrote:

The Array is used in VBA. The problem is Miguel is trying to use VBA from
the VB.Net environment. Which won't work. So Miguel, you can use 1 for the
missing constant (xlDelimited). However, this does not solve the Array. I
believe you can't just declare a VB.Net array and pass it to Excel, since it
is expecting a Variant type.
You will probably have to do a little research on passing arrays to Excel.
Good Luck,
Mark

"Dave Peterson" wrote:

I don't speak VB6, but I'm kind of amazed that it doesn't know about arrays.

Are you sure that portion caused a problem?

Miguel Arenas wrote:

Thanks you.
What you think about array?

"Dave Peterson" wrote:

I don't use VB, but if you open excel,
then hit alt-f11 to get to the VBE
then hit ctrl-g to see the immediate window

You can type:
?xldelimited
and see that it's equal to 1.

And
?xldoublequote
is also 1

Then you can use the numbers instead of using the xl constants.


==
But you could use a reference to:
Microsoft Excel xx.x Object Library



Miguel Arenas wrote:

I had a application in Vb 6.0, but is not working any more, because we are
using Office 2003. I development a new aplicacion with vb.2003 but I have a
problem in this section

oExcelApp.Workbooks.OpenText(FileName:=Warchivotxt , Origin:=437,
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False,
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 3),
Array(3, 1), Array(4, 3), Array(5, 3), Array(6, 1), Array(7, 3), Array(8, 2),
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2), Array(13, 2),
Array(14, 2), Array(15, 2), Array(16, 2), Array(17, 2), Array(18, 1),
Array(19, 1), Array(20, 2), Array(21, 2), Array(22, 2), Array(23, 2),
Array(24, 2), Array(25, 1), Array(26, 2), Array(27, 1), Array(28, 1),
Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), Array(33, 1),
Array(34, 1), Array(35, 1), Array(36, 2), Array(37, 1), Array(38, 1),
Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1),
Array(44, 2), Array(45, 2), Array(46, 2)))

The problem vb.2003 don't know the constants Array, xlDelimited, I want to
know wich refrence a need to add.
The project has this reference
Imports Microsoft.Office.Interop.Excel
and this objects
Dim oWs As New Microsoft.Office.Interop.Excel.Worksheet
Dim oWb As Microsoft.Office.Interop.Excel.Workbook
Dim oExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim sNewXlsFile As String
Dim sXlsTemplate As String
Dim wversion As String

sNewXlsFile = txtFile.Text
sXlsTemplate = txtFile.Text
oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = False
oExcelApp.Workbooks.Add()
oWs = oExcelApp.ActiveSheet
oWb = oExcelApp.ActiveWorkbook
Can somebody help me ?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
eula pops up every time i open an office program. office 2003 ins. ijscholl Excel Discussion (Misc queries) 0 July 28th 09 11:54 PM
Office 2007 compatibility pack on Office 2003 (slow network file fox_mulder33 Setting up and Configuration of Excel 0 January 2nd 08 03:28 PM
Upgrading from Office 2003 Small Bus to Office 2003 Pro Kelly Setting up and Configuration of Excel 0 September 25th 06 06:07 PM
Office 2000/Office 2003 Excel not printing landscape vise versa BAHTTEXT in English text Setting up and Configuration of Excel 1 April 17th 06 01:37 PM
Problem sharing spreadsheet between Office10 (Office XP) and Office 11 (Office 2003) Sage Solutions Group Excel Programming 0 August 20th 04 08:58 PM


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"