Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Windows.RangeFromPoint method is not working properly

RangeFromPoint method is not working ok when the direction righ_to_left

I'm the position from of cursor by Windows.Forms.Cursor.Position() and then
I invoke Window.RangeFromPoint with coordination I got from Cursor.

It works perfect when the direction of the work book is left to right.

Regards
Raja
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Windows.RangeFromPoint method is not working properly

Raja,
I don't have a R to L system handy, but are the coordinates reversed ?
Or something else ?

NickHK

"Raja" wrote in message
...
RangeFromPoint method is not working ok when the direction righ_to_left

I'm the position from of cursor by Windows.Forms.Cursor.Position() and

then
I invoke Window.RangeFromPoint with coordination I got from Cursor.

It works perfect when the direction of the work book is left to right.

Regards
Raja



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Windows.RangeFromPoint method is not working properly

Hello NickHK,

how could I do the coordinates reversed?

I've tried to that using Application.Width and Application.Left and
Window.Left and Window.Width. but i got wrong values from these properties.
for instance
Application.Width was 966 instead of 1200 which my resolution.

Regards
Raja


"NickHK" wrote:

Raja,
I don't have a R to L system handy, but are the coordinates reversed ?
Or something else ?

NickHK

"Raja" wrote in message
...
RangeFromPoint method is not working ok when the direction righ_to_left

I'm the position from of cursor by Windows.Forms.Cursor.Position() and

then
I invoke Window.RangeFromPoint with coordination I got from Cursor.

It works perfect when the direction of the work book is left to right.

Regards
Raja




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Windows.RangeFromPoint method is not working properly

Raja,
Yes, I get Application.Width =966 with a screen resolution set at 1280 x
1027 pixels.
It all depends on which units your various coordinates are in and also
relative to what.
You will (probably) need some conversion between Windows coords<Excel
coords.

So what do you mean by "RangeFromPoint method is not working ok" ?
And "It works perfect when the direction of the work book is left to right"
?

NickHK

"Raja" wrote in message
...
Hello NickHK,

how could I do the coordinates reversed?

I've tried to that using Application.Width and Application.Left and
Window.Left and Window.Width. but i got wrong values from these

properties.
for instance
Application.Width was 966 instead of 1200 which my resolution.

Regards
Raja


"NickHK" wrote:

Raja,
I don't have a R to L system handy, but are the coordinates reversed ?
Or something else ?

NickHK

"Raja" wrote in message
...
RangeFromPoint method is not working ok when the direction

righ_to_left

I'm the position from of cursor by Windows.Forms.Cursor.Position() and

then
I invoke Window.RangeFromPoint with coordination I got from Cursor.

It works perfect when the direction of the work book is left to right.

Regards
Raja






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Windows.RangeFromPoint method is not working properly

Hello NickHk,

thank you for your resopond, i feel we getting close to the solution. still
one question

How could I Convert the From Point value to Pixel Value? Could I take the
screenWidth/Application.Width ?

Regards
Raja

"NickHK" wrote:

Raja,
Yes, I get Application.Width =966 with a screen resolution set at 1280 x
1027 pixels.
It all depends on which units your various coordinates are in and also
relative to what.
You will (probably) need some conversion between Windows coords<Excel
coords.

So what do you mean by "RangeFromPoint method is not working ok" ?
And "It works perfect when the direction of the work book is left to right"
?

NickHK

"Raja" wrote in message
...
Hello NickHK,

how could I do the coordinates reversed?

I've tried to that using Application.Width and Application.Left and
Window.Left and Window.Width. but i got wrong values from these

properties.
for instance
Application.Width was 966 instead of 1200 which my resolution.

Regards
Raja


"NickHK" wrote:

Raja,
I don't have a R to L system handy, but are the coordinates reversed ?
Or something else ?

NickHK

"Raja" wrote in message
...
RangeFromPoint method is not working ok when the direction

righ_to_left

I'm the position from of cursor by Windows.Forms.Cursor.Position() and
then
I invoke Window.RangeFromPoint with coordination I got from Cursor.

It works perfect when the direction of the work book is left to right.

Regards
Raja








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Windows.RangeFromPoint method is not working properly

See the VBA below. Adapt to you .Net language. You should also get the
display resolution, but I have just hard coded to more common value using
Small Fonts of 96 dpi.
So whilst Help is not explicit, it would seem that the dimensions returned
about the Excel environemt are in points, not pixels.
Note: This assumes there are no task bars etc docked to the left/right of
the desktop. In release code, you should check for this.

Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long
Const SM_CXSCREEN = 0 'X Size of screen

Private Sub CommandButton1_Click()

Const SMALLFONTS_DPI As Long = 96
Const POINTS_INCH As Long = 72

With Application
.WindowState = xlMaximized

Debug.Print "Screen in Points = " & GetSystemMetrics(SM_CXSCREEN) /
SMALLFONTS_DPI * POINTS_INCH
Debug.Print "Application.Left = " & .Left
Debug.Print "Application.Width = " & .Width
End With

End Sub

NickHK

"Raja" wrote in message
...
Hello NickHk,

thank you for your resopond, i feel we getting close to the solution.

still
one question

How could I Convert the From Point value to Pixel Value? Could I take the
screenWidth/Application.Width ?

Regards
Raja

"NickHK" wrote:

Raja,
Yes, I get Application.Width =966 with a screen resolution set at 1280 x
1027 pixels.
It all depends on which units your various coordinates are in and also
relative to what.
You will (probably) need some conversion between Windows coords<Excel
coords.

So what do you mean by "RangeFromPoint method is not working ok" ?
And "It works perfect when the direction of the work book is left to

right"
?

NickHK

"Raja" wrote in message
...
Hello NickHK,

how could I do the coordinates reversed?

I've tried to that using Application.Width and Application.Left and
Window.Left and Window.Width. but i got wrong values from these

properties.
for instance
Application.Width was 966 instead of 1200 which my resolution.

Regards
Raja


"NickHK" wrote:

Raja,
I don't have a R to L system handy, but are the coordinates reversed

?
Or something else ?

NickHK

"Raja" wrote in message
...
RangeFromPoint method is not working ok when the direction

righ_to_left

I'm the position from of cursor by Windows.Forms.Cursor.Position()

and
then
I invoke Window.RangeFromPoint with coordination I got from

Cursor.

It works perfect when the direction of the work book is left to

right.

Regards
Raja








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
addin not working properly Kanan Excel Programming 0 March 28th 07 01:17 AM
But not working properly Rao Ratan Singh Excel Discussion (Misc queries) 2 September 14th 06 08:45 AM
Excel 2000 running on Windows XP SP2 does not properly open CSV fi Oscar Excel Discussion (Misc queries) 1 December 20th 04 10:10 PM
Does RangeFromPoint Method return ranges? Bernie Deitrick Excel Programming 4 May 5th 04 09:51 PM
export method not working properly Malone[_2_] Excel Programming 2 December 24th 03 08:34 PM


All times are GMT +1. The time now is 04:40 PM.

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

About Us

"It's about Microsoft Excel"