L
Luis Cesar
Hi,
I'm working developing software using Visual FoxPro 8.0 and Excel to build
reports.
Our systems use the following process to generate reports:
1) Process data and build a cursor with final results
1) Export cursor as Excel type (COPY TO ... TYPE XL5)
2) Instantiate the Excel (lsheet = GetObject('','excel.sheet'))
3) The exported sheet is opened in Excel
4) Insert a macro previously generated into Excel
(objeto.ActiveWorkBook.VBProject.VBComponents.Import (...))
5) Execute macro to format report
This process works fine since Excel 97, however in 2007 versions some macro
commands works in a different way.
See below the main difference:
- Positioning images:
This macro inserts a image inside a cell:
ActiveSheet.Cells(5, 5).Select
ActiveSheet.Pictures.Insert ("c:\path\logo.jpg")
Behavior until Excel 2003:
The image is positione ‘inside’ the cell. It means that left and top
position are the same for image and cell.
Behavior using Excel 2007:
Insert the image in an aleatory position.
- Change a text inside Textbox:
This macro inserts the Word ‘Office’ Inside a Textbox Previously created
with the text ‘Microsoft’:
ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal, 100, 100, 100,
100).Select
Selection.Text = "Microsoft"
Selection.Characters(10).Insert String:=" Office"
Behavior until Excel 2003:
I have a Textbox with text “Microsoft Officeâ€
Behavior using Excel 2007:
Run-time error ‘1004’:
Unable to get the Characters property of TextBox class.
Somebody knows some thing about this?
I'm working developing software using Visual FoxPro 8.0 and Excel to build
reports.
Our systems use the following process to generate reports:
1) Process data and build a cursor with final results
1) Export cursor as Excel type (COPY TO ... TYPE XL5)
2) Instantiate the Excel (lsheet = GetObject('','excel.sheet'))
3) The exported sheet is opened in Excel
4) Insert a macro previously generated into Excel
(objeto.ActiveWorkBook.VBProject.VBComponents.Import (...))
5) Execute macro to format report
This process works fine since Excel 97, however in 2007 versions some macro
commands works in a different way.
See below the main difference:
- Positioning images:
This macro inserts a image inside a cell:
ActiveSheet.Cells(5, 5).Select
ActiveSheet.Pictures.Insert ("c:\path\logo.jpg")
Behavior until Excel 2003:
The image is positione ‘inside’ the cell. It means that left and top
position are the same for image and cell.
Behavior using Excel 2007:
Insert the image in an aleatory position.
- Change a text inside Textbox:
This macro inserts the Word ‘Office’ Inside a Textbox Previously created
with the text ‘Microsoft’:
ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal, 100, 100, 100,
100).Select
Selection.Text = "Microsoft"
Selection.Characters(10).Insert String:=" Office"
Behavior until Excel 2003:
I have a Textbox with text “Microsoft Officeâ€
Behavior using Excel 2007:
Run-time error ‘1004’:
Unable to get the Characters property of TextBox class.
Somebody knows some thing about this?