VBA Sheet Size doesnt work

VBA Sheet Size doesnt work

Anonymous
Not applicable
426 Views
2 Replies
Message 1 of 3

VBA Sheet Size doesnt work

Anonymous
Not applicable

Hello,
I want to change the sheet size by macro.
But what ever I do, it changes only height... and width only after a second run of the macro.
How can I get the code run both size at once?

The code I use:

 

Dim oSheets As Sheet
Dim oDrawingDoc As DrawingDocument
Set oDrawingDoc = ThisApplication.ActiveDocument
Set oSheets = oDrawingDoc.ActiveSheet

oSheets.Size = DrawingSheetSizeEnum.kCustomDrawingSheetSize
oSheets.Height = 160
oSheets.Width = 250

 

0 Likes
Accepted solutions (1)
427 Views
2 Replies
Replies (2)
Message 2 of 3

frederic.vandenplas
Collaborator
Collaborator
Accepted solution

SyntaxEditor Code Snippet

Dim oSheets As Sheet
Dim oDrawingDoc As DrawingDocument
 oDrawingDoc = ThisApplication.ActiveDocument
 oSheets = oDrawingDoc.ActiveSheet

oSheets.Size = DrawingSheetSizeEnum.kCustomDrawingSheetSize

oSheets.Width = 250 
oSheets.Height = 160
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 3

Anonymous
Not applicable

ufff....
simply turn it Smiley Embarassed

thx

0 Likes