BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detect pagesetup.orientation of excel file

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
PlutoDev
Guest





PostPosted: Sat Dec 11, 2004 5:08 am    Post subject: Detect pagesetup.orientation of excel file Reply with quote



How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0



Back to top
George Birbilis
Guest





PostPosted: Sat Dec 11, 2004 11:09 am    Post subject: Re: Detect pagesetup.orientation of excel file Reply with quote



that's for printing (the page setup)
what do you mean orientation of excel file?

if Excel 2003 or similar has added macro-recording, try it and start
recording a macro - then do the action on the GUI that changes the
"orientation" (???) and stop the macro recording - see the VBA code it made
and you find out the API call you need

Quote:
How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0






Back to top
PlutuDev
Guest





PostPosted: Mon Dec 13, 2004 5:10 pm    Post subject: Re: Detect pagesetup.orientation of excel file Reply with quote



Page Setup for Printing ... using Landscape or portrait.
I have read source office*.pas in folder C:Program
FilesBorlandDelphi7OcxServers
but i don't understand how to used the functions and passing the parameter.

could you give me a sample code how to detect pagesetup.orientation.

I have try
worksheet.pagesetup.orientation
it's always return 0,
Portrait always return 2
Landscape always return 2

thank's in advance


"George Birbilis" <birbilis (AT) kagi (DOT) com> wrote

Quote:
that's for printing (the page setup)
what do you mean orientation of excel file?

if Excel 2003 or similar has added macro-recording, try it and start
recording a macro - then do the action on the GUI that changes the
"orientation" (???) and stop the macro recording - see the VBA code it
made
and you find out the API call you need

How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0








Back to top
Mariusz Celmer
Guest





PostPosted: Mon Dec 13, 2004 7:58 pm    Post subject: Re: Detect pagesetup.orientation of excel file Reply with quote

Hi,

XLApplication := CreateOleObject('Excel.Application');
XLApplication.Visible := True;
LWbk := XLApplication.Workbooks.Add(xlWBATWorksheet);

LSheets := LWbk.Sheets;
LSheet := LSheets.Item[1];

LSheet.PageSetup.Orientation := 1;
LSheet.Range['A1'].Value := LSheet.PageSetup.Orientation;
LSheet.PageSetup.Orientation := 2;
LSheet.Range['B2'].Value := LSheet.PageSetup.Orientation;

1 is portrait, 2 is landscape

hth,
Mariusz

"PlutuDev" <PlutoDev (AT) Yahoo (DOT) com> wrote

Quote:
Page Setup for Printing ... using Landscape or portrait.
I have read source office*.pas in folder C:Program
FilesBorlandDelphi7OcxServers
but i don't understand how to used the functions and passing the
parameter.

could you give me a sample code how to detect pagesetup.orientation.

I have try
worksheet.pagesetup.orientation
it's always return 0,
Portrait always return 2
Landscape always return 2

thank's in advance


"George Birbilis" <birbilis (AT) kagi (DOT) com> wrote in message
news:41bad57a$1 (AT) newsgroups (DOT) borland.com...
that's for printing (the page setup)
what do you mean orientation of excel file?

if Excel 2003 or similar has added macro-recording, try it and start
recording a macro - then do the action on the GUI that changes the
"orientation" (???) and stop the macro recording - see the VBA code it
made
and you find out the API call you need

How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0










Back to top
PlutuDev
Guest





PostPosted: Mon Dec 13, 2004 11:43 pm    Post subject: Re: Detect pagesetup.orientation of excel file Reply with quote

I have try it this code
landscape and portrait always return 0

Thanks

"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> wrote

Quote:
Hi,

XLApplication := CreateOleObject('Excel.Application');
XLApplication.Visible := True;
LWbk := XLApplication.Workbooks.Add(xlWBATWorksheet);

LSheets := LWbk.Sheets;
LSheet := LSheets.Item[1];

LSheet.PageSetup.Orientation := 1;
LSheet.Range['A1'].Value := LSheet.PageSetup.Orientation;
LSheet.PageSetup.Orientation := 2;
LSheet.Range['B2'].Value := LSheet.PageSetup.Orientation;

1 is portrait, 2 is landscape

hth,
Mariusz

"PlutuDev" <PlutoDev (AT) Yahoo (DOT) com> wrote in message
news:41bdcd00 (AT) newsgroups (DOT) borland.com...
Page Setup for Printing ... using Landscape or portrait.
I have read source office*.pas in folder C:Program
FilesBorlandDelphi7OcxServers
but i don't understand how to used the functions and passing the
parameter.

could you give me a sample code how to detect pagesetup.orientation.

I have try
worksheet.pagesetup.orientation
it's always return 0,
Portrait always return 2
Landscape always return 2

thank's in advance


"George Birbilis" <birbilis (AT) kagi (DOT) com> wrote in message
news:41bad57a$1 (AT) newsgroups (DOT) borland.com...
that's for printing (the page setup)
what do you mean orientation of excel file?

if Excel 2003 or similar has added macro-recording, try it and start
recording a macro - then do the action on the GUI that changes the
"orientation" (???) and stop the macro recording - see the VBA code it
made
and you find out the API call you need

How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0












Back to top
Mariusz Celmer
Guest





PostPosted: Tue Dec 14, 2004 9:20 am    Post subject: Re: Detect pagesetup.orientation of excel file Reply with quote

strange... I test it and works right...

did you use whole my sample or some part of it, and when I change
orientation is it changing in your Excel? I mean the lines:

Quote:
LSheet.PageSetup.Orientation := 1;
and
LSheet.PageSetup.Orientation := 2;


Mariusz


"PlutuDev" <PlutoDev (AT) Yahoo (DOT) com> wrote

Quote:
I have try it this code
landscape and portrait always return 0

Thanks

"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> wrote in message
news:41bdf3db (AT) newsgroups (DOT) borland.com...
Hi,

XLApplication := CreateOleObject('Excel.Application');
XLApplication.Visible := True;
LWbk := XLApplication.Workbooks.Add(xlWBATWorksheet);

LSheets := LWbk.Sheets;
LSheet := LSheets.Item[1];

LSheet.PageSetup.Orientation := 1;
LSheet.Range['A1'].Value := LSheet.PageSetup.Orientation;
LSheet.PageSetup.Orientation := 2;
LSheet.Range['B2'].Value := LSheet.PageSetup.Orientation;

1 is portrait, 2 is landscape

hth,
Mariusz

"PlutuDev" <PlutoDev (AT) Yahoo (DOT) com> wrote in message
news:41bdcd00 (AT) newsgroups (DOT) borland.com...
Page Setup for Printing ... using Landscape or portrait.
I have read source office*.pas in folder C:Program
FilesBorlandDelphi7OcxServers
but i don't understand how to used the functions and passing the
parameter.

could you give me a sample code how to detect pagesetup.orientation.

I have try
worksheet.pagesetup.orientation
it's always return 0,
Portrait always return 2
Landscape always return 2

thank's in advance


"George Birbilis" <birbilis (AT) kagi (DOT) com> wrote in message
news:41bad57a$1 (AT) newsgroups (DOT) borland.com...
that's for printing (the page setup)
what do you mean orientation of excel file?

if Excel 2003 or similar has added macro-recording, try it and start
recording a macro - then do the action on the GUI that changes the
"orientation" (???) and stop the macro recording - see the VBA code
it
made
and you find out the API call you need

How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0














Back to top
PlutuDev
Guest





PostPosted: Tue Dec 14, 2004 1:35 pm    Post subject: Re: Detect pagesetup.orientation of excel file Reply with quote

Sorry.
it works fined. I have try what's you wrote.

Before i use component TExcelApplication from Server pallete.
it's does not work.

Thanks for your help.



"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> wrote

Quote:
strange... I test it and works right...

did you use whole my sample or some part of it, and when I change
orientation is it changing in your Excel? I mean the lines:

LSheet.PageSetup.Orientation := 1;
and
LSheet.PageSetup.Orientation := 2;


Mariusz


"PlutuDev" <PlutoDev (AT) Yahoo (DOT) com> wrote in message
news:41be2923 (AT) newsgroups (DOT) borland.com...
I have try it this code
landscape and portrait always return 0

Thanks

"Mariusz Celmer" <Mariusz.Celmer (AT) poczta (DOT) neostrada.pl> wrote in message
news:41bdf3db (AT) newsgroups (DOT) borland.com...
Hi,

XLApplication := CreateOleObject('Excel.Application');
XLApplication.Visible := True;
LWbk := XLApplication.Workbooks.Add(xlWBATWorksheet);

LSheets := LWbk.Sheets;
LSheet := LSheets.Item[1];

LSheet.PageSetup.Orientation := 1;
LSheet.Range['A1'].Value := LSheet.PageSetup.Orientation;
LSheet.PageSetup.Orientation := 2;
LSheet.Range['B2'].Value := LSheet.PageSetup.Orientation;

1 is portrait, 2 is landscape

hth,
Mariusz

"PlutuDev" <PlutoDev (AT) Yahoo (DOT) com> wrote in message
news:41bdcd00 (AT) newsgroups (DOT) borland.com...
Page Setup for Printing ... using Landscape or portrait.
I have read source office*.pas in folder C:Program
FilesBorlandDelphi7OcxServers
but i don't understand how to used the functions and passing the
parameter.

could you give me a sample code how to detect pagesetup.orientation.

I have try
worksheet.pagesetup.orientation
it's always return 0,
Portrait always return 2
Landscape always return 2

thank's in advance


"George Birbilis" <birbilis (AT) kagi (DOT) com> wrote in message
news:41bad57a$1 (AT) newsgroups (DOT) borland.com...
that's for printing (the page setup)
what do you mean orientation of excel file?

if Excel 2003 or similar has added macro-recording, try it and
start
recording a macro - then do the action on the GUI that changes the
"orientation" (???) and stop the macro recording - see the VBA
code
it
made
and you find out the API call you need

How to detect the orientation of excel file
using Landscape or portrait.

i have try
worksheet.pagesetup.orientation
it's always return 0
















Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.