S
SoftwareTester
I'm using VBA from MS Project 2003.
I create an Excel sheet, write data to it and all works well.
Now, after writing data to it I want to set a printarea and I try the usual
with xlsheet '// being the Excelsheet creatd from MS Project
with .PageSetup
.Orientation = xlLandscape
.PrintArea = "$A$3:$N$158" '// Some address
end with
end with
while running it stops at the .Orientation statement with Error 1004
"Unable to set the Orientation property of the PageSetup class"
Adding .Activate doesn't make a difference
What could cause this problem and how to solve it?
I create an Excel sheet, write data to it and all works well.
Now, after writing data to it I want to set a printarea and I try the usual
with xlsheet '// being the Excelsheet creatd from MS Project
with .PageSetup
.Orientation = xlLandscape
.PrintArea = "$A$3:$N$158" '// Some address
end with
end with
while running it stops at the .Orientation statement with Error 1004
"Unable to set the Orientation property of the PageSetup class"
Adding .Activate doesn't make a difference
What could cause this problem and how to solve it?