Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Complie Error- Argument not optional

Recorded a macro to open a workbook then to preview then change settings in
page setup and when I run it I get the Compile Error.

Here's the area with an issue: It has no numbers for all but one margin ().
Seems like margin setting isn't recording. BottomMargin is highlighted.

ActiveWindow.SelectedSheets.PrintPreview

ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1

With ActiveSheet.PageSetup

.LeftMargin = Application.InchesToPoints(0.29)

.RightMargin = Application.InchesToPoints()

.TopMargin = Application.InchesToPoints()

.BottomMargin = Application.InchesToPoints()

.HeaderMargin = Application.InchesToPoints()

.FooterMargin = Application.InchesToPoints()

.Zoom = False

.FitToPagesWide = 1

.FitToPagesTall = 1

.PrintErrors = 13292

End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Complie Error- Argument not optional

Correction:

InchestoPoint is selected on the line for Left Margin not Bottom Margin.

"Roberta" wrote:

Recorded a macro to open a workbook then to preview then change settings in
page setup and when I run it I get the Compile Error.

Here's the area with an issue: It has no numbers for all but one margin ().
Seems like margin setting isn't recording. BottomMargin is highlighted.

ActiveWindow.SelectedSheets.PrintPreview

ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1

With ActiveSheet.PageSetup

.LeftMargin = Application.InchesToPoints(0.29)

.RightMargin = Application.InchesToPoints()

.TopMargin = Application.InchesToPoints()

.BottomMargin = Application.InchesToPoints()

.HeaderMargin = Application.InchesToPoints()

.FooterMargin = Application.InchesToPoints()

.Zoom = False

.FitToPagesWide = 1

.FitToPagesTall = 1

.PrintErrors = 13292

End With


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Complie Error- Argument not optional

You'll have to supply a number to the InchesToPoints method or delete those
lines. I don't know why you didn't get a number in the method when you
recorded (I always do) but you have to supply it anyway.

--
Jim
"Roberta" wrote in message
...
Correction:

InchestoPoint is selected on the line for Left Margin not Bottom Margin.

"Roberta" wrote:

Recorded a macro to open a workbook then to preview then change settings
in
page setup and when I run it I get the Compile Error.

Here's the area with an issue: It has no numbers for all but one margin
().
Seems like margin setting isn't recording. BottomMargin is highlighted.

ActiveWindow.SelectedSheets.PrintPreview

ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
RegionIndex:=1

With ActiveSheet.PageSetup

.LeftMargin = Application.InchesToPoints(0.29)

.RightMargin = Application.InchesToPoints()

.TopMargin = Application.InchesToPoints()

.BottomMargin = Application.InchesToPoints()

.HeaderMargin = Application.InchesToPoints()

.FooterMargin = Application.InchesToPoints()

.Zoom = False

.FitToPagesWide = 1

.FitToPagesTall = 1

.PrintErrors = 13292

End With




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Complie Error- Argument not optional

Even when I supply the inches it doesn't work and when I go back and look at
the VBA the numbers are not in the bracket.

I went to another PC and recorded and ran the same macro and its works but
form the one machine the recorded macro gets an error no matter whcih
workbook it is ran from. Any ideas?

"Jim Rech" wrote:

You'll have to supply a number to the InchesToPoints method or delete those
lines. I don't know why you didn't get a number in the method when you
recorded (I always do) but you have to supply it anyway.

--
Jim
"Roberta" wrote in message
...
Correction:

InchestoPoint is selected on the line for Left Margin not Bottom Margin.

"Roberta" wrote:

Recorded a macro to open a workbook then to preview then change settings
in
page setup and when I run it I get the Compile Error.

Here's the area with an issue: It has no numbers for all but one margin
().
Seems like margin setting isn't recording. BottomMargin is highlighted.

ActiveWindow.SelectedSheets.PrintPreview

ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
RegionIndex:=1

With ActiveSheet.PageSetup

.LeftMargin = Application.InchesToPoints(0.29)

.RightMargin = Application.InchesToPoints()

.TopMargin = Application.InchesToPoints()

.BottomMargin = Application.InchesToPoints()

.HeaderMargin = Application.InchesToPoints()

.FooterMargin = Application.InchesToPoints()

.Zoom = False

.FitToPagesWide = 1

.FitToPagesTall = 1

.PrintErrors = 13292

End With





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Complie Error- Argument not optional

Any ideas?

Not really. When one machine behaves differently than another you have to
ask how it is different. In this case since it involves printing you think
of the printer driver. But how that could cause this problem is beyond me.

--
Jim
"Roberta" wrote in message
...
| Even when I supply the inches it doesn't work and when I go back and look
at
| the VBA the numbers are not in the bracket.
|
| I went to another PC and recorded and ran the same macro and its works but
| form the one machine the recorded macro gets an error no matter whcih
| workbook it is ran from. Any ideas?
|
| "Jim Rech" wrote:
|
| You'll have to supply a number to the InchesToPoints method or delete
those
| lines. I don't know why you didn't get a number in the method when you
| recorded (I always do) but you have to supply it anyway.
|
| --
| Jim
| "Roberta" wrote in message
| ...
| Correction:
|
| InchestoPoint is selected on the line for Left Margin not Bottom
Margin.
|
| "Roberta" wrote:
|
| Recorded a macro to open a workbook then to preview then change
settings
| in
| page setup and when I run it I get the Compile Error.
|
| Here's the area with an issue: It has no numbers for all but one
margin
| ().
| Seems like margin setting isn't recording. BottomMargin is
highlighted.
|
| ActiveWindow.SelectedSheets.PrintPreview
|
| ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
| RegionIndex:=1
|
| With ActiveSheet.PageSetup
|
| .LeftMargin = Application.InchesToPoints(0.29)
|
| .RightMargin = Application.InchesToPoints()
|
| .TopMargin = Application.InchesToPoints()
|
| .BottomMargin = Application.InchesToPoints()
|
| .HeaderMargin = Application.InchesToPoints()
|
| .FooterMargin = Application.InchesToPoints()
|
| .Zoom = False
|
| .FitToPagesWide = 1
|
| .FitToPagesTall = 1
|
| .PrintErrors = 13292
|
| End With
|
|
|
|
|




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Complie Error- Argument not optional

Well I'm at a lost.....

"Jim Rech" wrote:

Any ideas?


Not really. When one machine behaves differently than another you have to
ask how it is different. In this case since it involves printing you think
of the printer driver. But how that could cause this problem is beyond me.

--
Jim
"Roberta" wrote in message
...
| Even when I supply the inches it doesn't work and when I go back and look
at
| the VBA the numbers are not in the bracket.
|
| I went to another PC and recorded and ran the same macro and its works but
| form the one machine the recorded macro gets an error no matter whcih
| workbook it is ran from. Any ideas?
|
| "Jim Rech" wrote:
|
| You'll have to supply a number to the InchesToPoints method or delete
those
| lines. I don't know why you didn't get a number in the method when you
| recorded (I always do) but you have to supply it anyway.
|
| --
| Jim
| "Roberta" wrote in message
| ...
| Correction:
|
| InchestoPoint is selected on the line for Left Margin not Bottom
Margin.
|
| "Roberta" wrote:
|
| Recorded a macro to open a workbook then to preview then change
settings
| in
| page setup and when I run it I get the Compile Error.
|
| Here's the area with an issue: It has no numbers for all but one
margin
| ().
| Seems like margin setting isn't recording. BottomMargin is
highlighted.
|
| ActiveWindow.SelectedSheets.PrintPreview
|
| ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
| RegionIndex:=1
|
| With ActiveSheet.PageSetup
|
| .LeftMargin = Application.InchesToPoints(0.29)
|
| .RightMargin = Application.InchesToPoints()
|
| .TopMargin = Application.InchesToPoints()
|
| .BottomMargin = Application.InchesToPoints()
|
| .HeaderMargin = Application.InchesToPoints()
|
| .FooterMargin = Application.InchesToPoints()
|
| .Zoom = False
|
| .FitToPagesWide = 1
|
| .FitToPagesTall = 1
|
| .PrintErrors = 13292
|
| End With
|
|
|
|
|



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
Interpreting "comma" where an optional argument is Epinn Excel Worksheet Functions 4 January 17th 07 12:04 AM
Compile Error Argument Not optional [email protected] Excel Discussion (Misc queries) 1 August 16th 06 04:58 PM
Complie Error Help JMay Excel Programming 4 January 24th 05 04:33 AM
complie error brian Excel Programming 2 December 13th 04 06:51 PM
Complie Error chris huber Excel Programming 3 January 14th 04 09:57 AM


All times are GMT +1. The time now is 11:04 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"