View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Unable to set the LeftFooter property of the PageSetup Class

Worked OK for me.


"Sierk" wrote in message
...
When running my macro I get the above mentioned Run-time error '1004'.
The
interesting thing is that when I assign the save variable that causes the
error for the LeftFooter to the RightFooter the error goes away. Does
anyone
know why, and/or how to circumvent this issue? (code below)

Set myData = New DataObject
myData.GetFromClipboard
vPath = myData.GetText(1)

'While the right most character is a Paragraph marker or a carriage
return
While Asc(Right(vPath, 1)) = 10 Or Asc(Right(vPath, 1)) = 13
'remove the paragraph marker
vPath = Mid(vPath, 1, Len(vPath) - 1)
Wend

vFont = "&""Times New Roman,Regular""&8"
vFile = " &F"
vCR = Chr(13)
vName = "CompanyName"

vLeftFooter = vFont & vPath & vFile & vCR & "&D"
vCenterFooter = vFont & "&P"
vRightFooter = vFont & vName
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.AlignMarginsHeaderFooter = False
.LeftFooter = vLeftFooter
.CenterFooter = vCenterFooter
.RightFooter = vLeftFooter
End With

--
Sierk