Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
HA HA is offline
external usenet poster
 
Posts: 4
Default Getting Zoom Factor

Hi,

Is there any possiblity to get zooming factor page setup if .zoom property set to false/true

thanks.

HA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Getting Zoom Factor

the following line will return the zoom percentage

MsgBox ActiveSheet.PageSetup.Zoom

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Getting Zoom Factor

activewindow.Zoom

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"HA" wrote in message
...
Hi,

Is there any possiblity to get zooming factor page setup if .zoom property
set to false/true

thanks.

HA


  #4   Report Post  
Posted to microsoft.public.excel.programming
HA HA is offline
external usenet poster
 
Posts: 4
Default Getting Zoom Factor

Sorry for describing the problem on wrong way...

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With


the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically.
if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False.
But from page setup dialog box, we can see the zoom factor.
I just want to know on that circumstance, is ther any possiblity to get zoom factor.

thanks...

--
HA
"Bob Phillips" , haber iletisinde þunlarý ...
activewindow.Zoom

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"HA" wrote in message
...
Hi,

Is there any possiblity to get zooming factor page setup if .zoom property
set to false/true

thanks.

HA


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Getting Zoom Factor

I don't think there is a way of getting what you want - zoom is a value
if true, or false if false, if false, then excel calculates on the fly
I think.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Getting Zoom Factor

I have never used it, but this was posted in the past:

Here's a post from Jim Rech/Nick Osdale-Popa.

Declare Function LockWindowUpdate Lib _
"user32" (ByVal hwndLock As Long) As Long
Declare Function FindWindowA Lib _
"user32" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long


Sub SetPageZoom()
Dim ZoomFactor As Integer
Dim hWnd As Long


hWnd = FindWindowA("XLMAIN", Application.Caption)
LockWindowUpdate hWnd


With ActiveSheet.PageSetup
.FitToPagesTall = False
.FitToPagesWide = 1
.Zoom = False
End With
'in order to calculate the Zoom %, a PrintPreview must initiated.
SendKeys "%C"
ActiveSheet.PrintPreview
'to get/set the Zoom %, initiate the Page Setup Dialog box.
SendKeys "P%A~"
Application.Dialogs(xlDialogPageSetup).Show
ZoomFactor = ActiveSheet.PageSetup.Zoom
ActiveSheet.PageSetup.Zoom = ZoomFactor


LockWindowUpdate 0
End Sub



--
Regards,
Tom Ogilvy


"HA" wrote:

Sorry for describing the problem on wrong way...

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With


the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically.
if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False.
But from page setup dialog box, we can see the zoom factor.
I just want to know on that circumstance, is ther any possiblity to get zoom factor.

thanks...

--
HA
"Bob Phillips" , haber iletisinde şunları ...
activewindow.Zoom

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"HA" wrote in message
...
Hi,

Is there any possiblity to get zooming factor page setup if .zoom property
set to false/true

thanks.

HA


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Getting Zoom Factor

Hi,
try this:

Sub Test()
Dim vRet As Variant

'FitToPagesWide <-- 1
'FitToPagesTall <-- 1
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" )

'Select the Zoom option
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})")

'Get the Zoom value
MsgBox ActiveSheet.PageSetup.Zoom
'or
'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)")
End Sub

--
HTH,
okaizawa


HA wrote:
Sorry for describing the problem on wrong way...

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With


the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically.
if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False.
But from page setup dialog box, we can see the zoom factor.
I just want to know on that circumstance, is ther any possiblity to get zoom factor.

thanks...

  #8   Report Post  
Posted to microsoft.public.excel.programming
HA HA is offline
external usenet poster
 
Posts: 4
Default Getting Zoom Factor

Hi,

Thanks for the code. I have one more question.

Is there any way to use that code in a User Defined Function.

thanks in advance...

--
HA

"okaizawa" , haber iletisinde ?unlar? ...
Hi,
try this:

Sub Test()
Dim vRet As Variant

'FitToPagesWide <-- 1
'FitToPagesTall <-- 1
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" )

'Select the Zoom option
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})")

'Get the Zoom value
MsgBox ActiveSheet.PageSetup.Zoom
'or
'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)")
End Sub

--
HTH,
okaizawa


HA wrote:
Sorry for describing the problem on wrong way...

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With


the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically.
if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False.
But from page setup dialog box, we can see the zoom factor.
I just want to know on that circumstance, is ther any possiblity to get zoom factor.

thanks...

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Getting Zoom Factor

Function ZoomFactor()
ZoomFactor = Windows(Application.Caller.Parent.Parent.Name).Zoo m
End Function


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"HA" wrote in message
...
Hi,

Thanks for the code. I have one more question.

Is there any way to use that code in a User Defined Function.

thanks in advance...

--
HA

"okaizawa" , haber iletisinde ?unlar?
...
Hi,
try this:

Sub Test()
Dim vRet As Variant

'FitToPagesWide <-- 1
'FitToPagesTall <-- 1
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" )

'Select the Zoom option
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})")

'Get the Zoom value
MsgBox ActiveSheet.PageSetup.Zoom
'or
'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)")
End Sub

--
HTH,
okaizawa


HA wrote:
Sorry for describing the problem on wrong way...

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With


the problem is when fit to pages wide and tall selected from page setup

(as you see in the code), zoom property set to false automatically.
if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom

returns False.
But from page setup dialog box, we can see the zoom factor.
I just want to know on that circumstance, is ther any possiblity to get

zoom factor.

thanks...



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Getting Zoom Factor

Sorry, I meant

Function ZoomFactor()
ZoomFactor = Worksheets(Application.Caller.Parent.Name).PageSet up.Zoom
End Function


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"HA" wrote in message
...
Hi,

Thanks for the code. I have one more question.

Is there any way to use that code in a User Defined Function.

thanks in advance...

--
HA

"okaizawa" , haber iletisinde ?unlar?
...
Hi,
try this:

Sub Test()
Dim vRet As Variant

'FitToPagesWide <-- 1
'FitToPagesTall <-- 1
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" )

'Select the Zoom option
vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})")

'Get the Zoom value
MsgBox ActiveSheet.PageSetup.Zoom
'or
'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)")
End Sub

--
HTH,
okaizawa


HA wrote:
Sorry for describing the problem on wrong way...

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With


the problem is when fit to pages wide and tall selected from page setup

(as you see in the code), zoom property set to false automatically.
if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom

returns False.
But from page setup dialog box, we can see the zoom factor.
I just want to know on that circumstance, is ther any possiblity to get

zoom factor.

thanks...





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Getting Zoom Factor

Is there any way to use that code in a User Defined Function.
I don't think it is possible in a cell formula.
how about Worksheet_Change or Worksheet_Calculate?

http://msdn.microsoft.com/library/en...HV05199719.asp
http://msdn.microsoft.com/library/en...HV05199619.asp

--
HTH,
okaizawa

HA wrote:
Hi,

Thanks for the code. I have one more question.

Is there any way to use that code in a User Defined Function.

thanks in advance...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
X Factor into Percent... Joseph Hand Excel Worksheet Functions 3 February 24th 10 09:54 AM
Please help! Print Preview Zoom is Grayed Out...Doesn't zoom. PK Excel Discussion (Misc queries) 0 July 20th 09 03:33 PM
Time factor Debbie Excel Worksheet Functions 7 June 8th 09 10:22 PM
IF FACTOR? Bernadette Excel Discussion (Misc queries) 2 June 8th 06 01:51 PM
Growth Factor Laura Excel Discussion (Misc queries) 2 May 15th 06 10:43 PM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"