Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable to set the LeftFooter property of the PageSetup Class
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable to set the LeftFooter property of the PageSetup Class
Thanks, must have been Tuesday, a full moon, or perhaps there was something
in my coffee. Now it works for me too, even though I have no idea why it didn't work yesterday and why it does work today. Go figure. -- Sierk "JLGWhiz" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to set the LeftHeader property of the PageSetup class | Excel Programming | |||
Unable to set the Orientation property of the PageSetup class | Excel Programming | |||
Unable to set the PaperSize property of the PageSetup class | Excel Programming | |||
Unable to Set LeftFooter Property Class PageSetup (ASP) | Excel Programming | |||
Unable to set the PrintQuality property of the PageSetup class. | Excel Programming |