excel - Getting a 400 error in VBA -
i'm getting frustrating error in macro code. have small bit of code in 2 subs 1 opens data groups , changes of print options , other closes groups , changes of print options.
this works fine when save , close on re-open if click macro buttons 400 error message. fix have comment out .pagesetup code , run macros again uncomment , run macro line line , 400 error disappear. once save , close come , have repeat everything. appreciated.
sub propertystrat_click() ' ' propertystrat_click macro ' activesheet.outline.showlevels rowlevels:=2 ' expand rows worksheets("sheet1").pagesetup.orientation = xlportrait worksheets("sheet1").pagesetup.papersize = xlpapera3 worksheets("sheet1").pagesetup.zoom = false worksheets("sheet1").pagesetup.fittopagestall = 1 worksheets("sheet1").pagesetup.fittopageswide = 1 worksheets("sheet1").pagesetup.centerhorizontally = true worksheets("sheet1").pagesetup.centervertically = true end sub sub simpleview_click() activesheet.outline.showlevels rowlevels:=1 ' collapse rows worksheets("sheet1").pagesetup.printarea = "$a$1:$j$29,$a$30:$j$50" worksheets("sheet1").pagesetup.orientation = xllandscape worksheets("sheet1").pagesetup.papersize = xlpapera4 worksheets("sheet1").pagesetup.zoom = 100 worksheets("sheet1").pagesetup.centerhorizontally = false worksheets("sheet1").pagesetup.centervertically = false end sub
Comments
Post a Comment