J
JIM
I'm doing the simplest task - to fill a cell with a ctrl+a key with the
following code:
Sub PrintName()
'
' PrintName Macro
' Print Waterbury
' Keyboard Shortcut: Ctrl+a
'
ActiveCell.FormulaR1C1 = ""
Range("A11").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Application.CommandBars("Stop Recording").Visible = False
Application.CommandBars("Task Pane").Visible = False
ActiveCell.FormulaR1C1 = "Waterbury"
Range("C2").Select
Application.Run "PERSONAL.XLS!PrintName" 'it stops here
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Monty\My Documents\Book1.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWindow.Close
Workbooks.Add
End Sub
It stops at line -Application.Run "Personal.XLS!PrintName" and highlights it
yellow. I get a run-time error 28: Out of stack space. It seems to be in a
continuous loop until it runs out of memory.
Any hints appreciated.
following code:
Sub PrintName()
'
' PrintName Macro
' Print Waterbury
' Keyboard Shortcut: Ctrl+a
'
ActiveCell.FormulaR1C1 = ""
Range("A11").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Application.CommandBars("Stop Recording").Visible = False
Application.CommandBars("Task Pane").Visible = False
ActiveCell.FormulaR1C1 = "Waterbury"
Range("C2").Select
Application.Run "PERSONAL.XLS!PrintName" 'it stops here
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Monty\My Documents\Book1.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWindow.Close
Workbooks.Add
End Sub
It stops at line -Application.Run "Personal.XLS!PrintName" and highlights it
yellow. I get a run-time error 28: Out of stack space. It seems to be in a
continuous loop until it runs out of memory.
Any hints appreciated.