ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Camera Tool (https://www.excelbanter.com/excel-programming/400763-camera-tool.html)

Christina

Camera Tool
 
Hello All,

I Have a problem of using Excel Camera command in my macro. Here is my codes:

ActiveSheet.Range("A4:H15").Select
Selection.Copy
ActiveSheet.Pictures.Add(201.75, 192.75, 375, 328.5).Select
Selection.Height = 294
Selection.Width = 410.25

It works well in most of my computer. However, I have a problem in one
computer. The content of the range A4:H15 that I size it to fit with the
width 410.25 and the height = 294 is larger than the normale and it also move
a little to the left. I think the problem is from the printer configuration
but I do not know which part. Any clue will be very appreciated.

Christine

Jim Rech

Camera Tool
 
If I follow you correctly I think you should do something like this:

Selection.Height = Range("A4:H15").Height
Selection.Width = Range("A4:H15").Width

--
Jim
"Christina" wrote in message
...
| Hello All,
|
| I Have a problem of using Excel Camera command in my macro. Here is my
codes:
|
| ActiveSheet.Range("A4:H15").Select
| Selection.Copy
| ActiveSheet.Pictures.Add(201.75, 192.75, 375, 328.5).Select
| Selection.Height = 294
| Selection.Width = 410.25
|
| It works well in most of my computer. However, I have a problem in one
| computer. The content of the range A4:H15 that I size it to fit with the
| width 410.25 and the height = 294 is larger than the normale and it also
move
| a little to the left. I think the problem is from the printer
configuration
| but I do not know which part. Any clue will be very appreciated.
|
| Christine



Christina

Camera Tool
 
Hi Jim,

Hi Jim,
The problem is not the syntax error but it is is possible from the setting
of the printer on each computer. On the computer that I have problem the
picture selected from the Camera is no more proportion with the page. It is
bigger and not at the right position. However, on all of my others computers,
the picture is at the right position.
Christine

"Jim Rech" wrote:

If I follow you correctly I think you should do something like this:

Selection.Height = Range("A4:H15").Height
Selection.Width = Range("A4:H15").Width

--
Jim
"Christina" wrote in message
...
| Hello All,
|
| I Have a problem of using Excel Camera command in my macro. Here is my
codes:
|
| ActiveSheet.Range("A4:H15").Select
| Selection.Copy
| ActiveSheet.Pictures.Add(201.75, 192.75, 375, 328.5).Select
| Selection.Height = 294
| Selection.Width = 410.25
|
| It works well in most of my computer. However, I have a problem in one
| computer. The content of the range A4:H15 that I size it to fit with the
| width 410.25 and the height = 294 is larger than the normale and it also
move
| a little to the left. I think the problem is from the printer
configuration
| but I do not know which part. Any clue will be very appreciated.
|
| Christine




Jim Rech[_2_]

Camera Tool
 
Sorry my point wasn't clear. I don't recall saying anything about a syntax
error. Your problem is that you are hard wiring coordinates on the
assumption that they hold across machines. You have to determine them
dynamically. My code (I cannot tell if you tried it) dynamically determines
the size (as best I can tell what you're doing) but not the location.
Something like this: 201.75, 192.75, 375, 328.5 is a nonstarter. Use
Range("B10").Left, Range("B10").Top, etc.

--
Jim
"Christina" wrote in message
...
| Hi Jim,
|
| Hi Jim,
| The problem is not the syntax error but it is is possible from the setting
| of the printer on each computer. On the computer that I have problem the
| picture selected from the Camera is no more proportion with the page. It
is
| bigger and not at the right position. However, on all of my others
computers,
| the picture is at the right position.
| Christine
|
| "Jim Rech" wrote:
|
| If I follow you correctly I think you should do something like this:
|
| Selection.Height = Range("A4:H15").Height
| Selection.Width = Range("A4:H15").Width
|
| --
| Jim
| "Christina" wrote in message
| ...
| | Hello All,
| |
| | I Have a problem of using Excel Camera command in my macro. Here is my
| codes:
| |
| | ActiveSheet.Range("A4:H15").Select
| | Selection.Copy
| | ActiveSheet.Pictures.Add(201.75, 192.75, 375, 328.5).Select
| | Selection.Height = 294
| | Selection.Width = 410.25
| |
| | It works well in most of my computer. However, I have a problem in one
| | computer. The content of the range A4:H15 that I size it to fit with
the
| | width 410.25 and the height = 294 is larger than the normale and it
also
| move
| | a little to the left. I think the problem is from the printer
| configuration
| | but I do not know which part. Any clue will be very appreciated.
| |
| | Christine
|
|
|




All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com