Skip to main content

[archive] Need a little help with Excel transalation

  • November 3, 2006
  • 3 replies
  • 0 views

[Migrated content. Thread originally posted on 02 November 2006]

Hi guys,

I'm trying to translate following vb codes to cobol:
[INDENT]1. ExcelApp.ActiveCell.SpecialCells(xlCellTypeLastCell).Select
[INDENT]
[/INDENT]2. Excel-Column = ExcelApp.ActiveCell.Column
[INDENT]
[/INDENT]3. Excel-Row = ExcelApp.ActiveCell.Row[/INDENT]


it is to find the "RIGHT" most cell of a spreadsheet so that when I read the spreadsheet, I would know the limit of the row and column. I can't seem get the line 1 right. If there is a easier or better way find it, please let me know.

And another VB code I am having difficult is:
[INDENT]ExcelApp.Cells(1 , 1).Value = "Column A Row 1"[/INDENT]
It should translate to:
[INDENT]Modify ExcelApp @Cells(1 , 1)::Value = "Column A Row 1"[/INDENT]
but I'm getting a compile error message. "wrong number of parameters: 0 expected, 2 found.

Thanks in advance
Chin

3 replies

[Migrated content. Thread originally posted on 02 November 2006]

Hi guys,

I'm trying to translate following vb codes to cobol:
[INDENT]1. ExcelApp.ActiveCell.SpecialCells(xlCellTypeLastCell).Select
[INDENT]
[/INDENT]2. Excel-Column = ExcelApp.ActiveCell.Column
[INDENT]
[/INDENT]3. Excel-Row = ExcelApp.ActiveCell.Row[/INDENT]


it is to find the "RIGHT" most cell of a spreadsheet so that when I read the spreadsheet, I would know the limit of the row and column. I can't seem get the line 1 right. If there is a easier or better way find it, please let me know.

And another VB code I am having difficult is:
[INDENT]ExcelApp.Cells(1 , 1).Value = "Column A Row 1"[/INDENT]
It should translate to:
[INDENT]Modify ExcelApp @Cells(1 , 1)::Value = "Column A Row 1"[/INDENT]
but I'm getting a compile error message. "wrong number of parameters: 0 expected, 2 found.

Thanks in advance
Chin

MODIFY  ExcelApp ActiveCell::SpecialCells(xlCellTypeLastCell)::Select().


The problem with ExcelApp.Cells(1. 1).Value is due to the default value of the range object. Try this one:

MODIFY  ExcelApp          @Cells::Item(1 , 1, "Column A Row 1").

[Migrated content. Thread originally posted on 02 November 2006]

Hi guys,

I'm trying to translate following vb codes to cobol:
[INDENT]1. ExcelApp.ActiveCell.SpecialCells(xlCellTypeLastCell).Select
[INDENT]
[/INDENT]2. Excel-Column = ExcelApp.ActiveCell.Column
[INDENT]
[/INDENT]3. Excel-Row = ExcelApp.ActiveCell.Row[/INDENT]


it is to find the "RIGHT" most cell of a spreadsheet so that when I read the spreadsheet, I would know the limit of the row and column. I can't seem get the line 1 right. If there is a easier or better way find it, please let me know.

And another VB code I am having difficult is:
[INDENT]ExcelApp.Cells(1 , 1).Value = "Column A Row 1"[/INDENT]
It should translate to:
[INDENT]Modify ExcelApp @Cells(1 , 1)::Value = "Column A Row 1"[/INDENT]
but I'm getting a compile error message. "wrong number of parameters: 0 expected, 2 found.

Thanks in advance
Chin
Gilse,
Thanks for the help.
The code
[INDENT]MODIFY ExcelApp ActiveCell::SpecialCells(xlCellTypeLastCell)::Select().[/INDENT]
produed following compile error:

[INDENT]'SPECIALCELLS' must be a 'get' property of '@RANGE'[/INDENT]

I've tried the INQUIRE verb but I'm not getting anywhere.
The other code worked great. Is this kind of stuff you will be covering during the Advanced Windows programming in Atl?

Chin

[Migrated content. Thread originally posted on 02 November 2006]

Hi guys,

I'm trying to translate following vb codes to cobol:
[INDENT]1. ExcelApp.ActiveCell.SpecialCells(xlCellTypeLastCell).Select
[INDENT]
[/INDENT]2. Excel-Column = ExcelApp.ActiveCell.Column
[INDENT]
[/INDENT]3. Excel-Row = ExcelApp.ActiveCell.Row[/INDENT]


it is to find the "RIGHT" most cell of a spreadsheet so that when I read the spreadsheet, I would know the limit of the row and column. I can't seem get the line 1 right. If there is a easier or better way find it, please let me know.

And another VB code I am having difficult is:
[INDENT]ExcelApp.Cells(1 , 1).Value = "Column A Row 1"[/INDENT]
It should translate to:
[INDENT]Modify ExcelApp @Cells(1 , 1)::Value = "Column A Row 1"[/INDENT]
but I'm getting a compile error message. "wrong number of parameters: 0 expected, 2 found.

Thanks in advance
Chin
You might get the compiler error due to one of two reasons:

1. (most likely I am afraid) We had a bug in the compiler parsing of
inline objects that would cause this error. I don't remember what
version we corrected this in, but it is for sure corrected in version
7.2.0.

2. This property SpecialCells is not defined in your version of Excel. I
use Office 2003, it might be that this is not present in former versions.
This you should be able to figure out by inspecting the definition file,
if you find the SpecialCells there, then see if it is related to the
Range class.

Yes, interoperability with Microsoft Office is a solid part of the Advanced Windows training. We discuss the Microsoft Office object model, go through the documentation of this. We discuss ACUCOBOL-GT COM syntax, compare this to the vb scripting (which is where you will find the most examples). We practise interoperability, we step through examples, write programs.
Besides this we also cover the Windows API, discuss Windows technologies and of Microsoft ActiveX components. There is also talk of .net, but that is not as much covered as COM.

Not to forget that you get a CD full of source examples on how to do all the stuff.

If you want to attend, you better get in touch with Acucorp sales asap, within a month the events taking place in Italy, South Africa, Chicago and Atlanta are all history. I also know some of these locations are close to the limit of the number of attendees now.