View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
carlo carlo is offline
external usenet poster
 
Posts: 367
Default From variable to excel constant

Try not to apply the text xlPortrait, but the integer of this
constant.

xlPortrait = 1
xlLandscape = 2

hth

Carlo

On Dec 6, 11:11 am, Carmen wrote:
In an excel sheet I'm allowing users to pick from dropdown whether they want
to print in xlPortrait or xlLandscape. It's not feasible to go directly to
Page setup because this page setup that we are applying is for another file.

However, when I read this choice to a variable and setting
pagesetup.orientation to this variable, it doesn't recognize it. This is
because xlPortrait should not be a text, but a constant.

Is there a formula to convert the string to constant? I must allow user to
do the selection in the worksheet.

Thanks,
Carmen