Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
Unable to set the LeftHeader property of the PageSetup class John[_140_] Excel Programming 7 November 9th 08 01:52 PM
Unable to set the Orientation property of the PageSetup class Aero[_2_] Excel Programming 1 March 17th 06 01:03 PM
Unable to set the PaperSize property of the PageSetup class [email protected] Excel Programming 2 November 22nd 04 03:43 PM
Unable to Set LeftFooter Property Class PageSetup (ASP) fredlankovich Excel Programming 0 June 23rd 04 07:56 PM
Unable to set the PrintQuality property of the PageSetup class. No Name Excel Programming 1 January 14th 04 04:43 PM


All times are GMT +1. The time now is 09:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"