Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi there,
I have aVB.net app that create a excel workseet on the fly. and i want to set up all margins to 0. I tried the following and got an error message saying "margins do not fit page size". i was able to do almost anything like setting a font for a cell and so forth ... but no this. ' ' of course i have declare objects on top ' objSheet.PageSetup.FooterMargin = objApp.InchesToPoints(0) objSheet.PageSetup.BottomMargin = objApp.InchesToPoints(0) objSheet.PageSetup.TopMargin = objApp.InchesToPoints(0) objSheet.PageSetup.BottomMargin = objApp.InchesToPoints(0) objSheet.PageSetup.LeftMargin = objApp.InchesToPoints(0) objSheet.PageSetup.RightMargin = objApp.InchesToPoints(0) I have zebra barcode label printer as a default printer and set 1.25" X 1.00" as a default paper size. please help me. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
some printerdrivers just wont accept 0 margins.
(you could try fiddling around in the printer driver's install.. PPD files...) however to minimize margins try like following: in vba (not NET) this works... Sub minMargins() On Error Resume Next With ActiveSheet.PageSetup Debug.Print .TopMargin, .BottomMargin, .LeftMargin, .RightMargin .TopMargin = 0 .BottomMargin = 0 .LeftMargin = 0 .TopMargin = 0 Debug.Print .TopMargin, .BottomMargin, .LeftMargin, .RightMargin .TopMargin = .BottomMargin / 2 .BottomMargin = .TopMargin .LeftMargin = .RightMargin / 2 .RightMargin = .LeftMargin Debug.Print .TopMargin, .BottomMargin, .LeftMargin, .RightMargin End With End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Mike Kim" wrote: hi there, I have aVB.net app that create a excel workseet on the fly. and i want to set up all margins to 0. I tried the following and got an error message saying "margins do not fit page size". i was able to do almost anything like setting a font for a cell and so forth ... but no this. ' ' of course i have declare objects on top ' objSheet.PageSetup.FooterMargin = objApp.InchesToPoints(0) objSheet.PageSetup.BottomMargin = objApp.InchesToPoints(0) objSheet.PageSetup.TopMargin = objApp.InchesToPoints(0) objSheet.PageSetup.BottomMargin = objApp.InchesToPoints(0) objSheet.PageSetup.LeftMargin = objApp.InchesToPoints(0) objSheet.PageSetup.RightMargin = objApp.InchesToPoints(0) I have zebra barcode label printer as a default printer and set 1.25" X 1.00" as a default paper size. please help me. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error message "Margins do not fit page size" in Excel? | Excel Discussion (Misc queries) | |||
error message - "margins do not fit page size" | Excel Discussion (Misc queries) | |||
how do i fix error message 'margins do not fit page size' | Excel Discussion (Misc queries) | |||
Margins do not fit page size! | Excel Discussion (Misc queries) | |||
"Margins do not fit page size" error, but I'm not printing! | Excel Discussion (Misc queries) |