# Excel PrintArea

**URL:** <https://forum.xojo.com/t/excel-printarea/37877>\
**Category:** Français\
**Created:** [May 28, 2017, 4:32pm UTC](https://forum.xojo.com/t/excel-printarea/37877 "2017-05-28T16:32:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![julien\_assayah](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@julien\_assayah](https://forum.xojo.com/u/julien_assayah)\
**Post date:** [May 28, 2017, 4:32pm UTC](https://forum.xojo.com/t/excel-printarea/37877/1 "2017-05-28T16:32:53Z")

</div>

Bonjour, comment dfinir une zone d’impression avec la classe “ExcelAreas” ??  
mais comment crire le code, je bloque compltement…

merci.

---

<div class="post-metadata">

**Author:** ![Eugene\_Dakin](https://forum.xojo.com/user_avatar/forum.xojo.com/eugene_dakin/32/178_2.png) [@Eugene\_Dakin](https://forum.xojo.com/u/Eugene_Dakin)\
**Post date:** [May 28, 2017, 5:32pm UTC](https://forum.xojo.com/t/excel-printarea/37877/2 "2017-05-28T17:32:29Z")

</div>

Here is an example that shows a print area. Does your question mean ExcelAreas = PrintArea?

[code]Dim excel as new ExcelApplication  
excel.Workbooks.Add  
excel.visible = true

//New data in cells  
excel.Range(“A1:C3”).Value = “text”

//Print cell data  
excel.ActiveSheet.PageSetup.PrintArea = “A1:B2”  
MsgBox “Print area has a box on Excel”  
excel.ActiveSheet.Range(“A1:B2”).Printout

//Close excel  
excel.ActiveWorkbook.close false  
excel.Quit  
excel = nil

Exception err as OLEException  
MsgBox err.message[/code]

Let me know if I misunderstand. 🙂

---

<div class="post-metadata">

**Author:** ![julien\_assayah](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@julien\_assayah](https://forum.xojo.com/u/julien_assayah)\
**Post date:** [May 28, 2017, 6:28pm UTC](https://forum.xojo.com/t/excel-printarea/37877/3 "2017-05-28T18:28:23Z")

</div>

[quote=333048:@Eugene Dakin]Here is an example that shows a print area. Does your question mean ExcelAreas = PrintArea?

[code]Dim excel as new ExcelApplication  
excel.Workbooks.Add  
excel.visible = true

//New data in cells  
excel.Range(“A1:C3”).Value = “text”

//Print cell data  
excel.ActiveSheet.PageSetup.PrintArea = “A1:B2”  
MsgBox “Print area has a box on Excel”  
excel.ActiveSheet.Range(“A1:B2”).Printout

//Close excel  
excel.ActiveWorkbook.close false  
excel.Quit  
excel = nil

Exception err as OLEException  
MsgBox err.message[/code]

Let me know if I misunderstand. :)[/quote]  
Oui, je voulais savoir s’il fallait utiliser excelarea for printarea, mais je vois que non!!

Merci beaucoup ! C’est super !

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:47pm UTC](https://forum.xojo.com/t/excel-printarea/37877/4 "2020-10-29T18:47:18Z")

</div>


