Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Compile error for macros

I am trying to create a macros to enter the filepath in
the footer of an excel document. Here is what MS Office's
site said to create:

Sub UpdateFooter()
Sheet1.PageSetup.LeftFooter=
ActiveWorkbook.FullName
End Sub

When I do this I get a compile error expected:expression.
What am I doing wrong?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compile error for macros

This line of code should be on a single line


Sheet1.PageSetup.LeftFooter = ActiveWorkbook.FullNam

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Compile error for macros

Michael,

The second and third line should be one line...
Sheet1.PageSetup.LeftFooter = ActiveWorkbook.FullName

When a line of code is split up, a line continuation character is needed.
That would be a space followed by the underscore " _" (without the quote marks).

Using the above the code line would look like...
Sheet1.PageSetup.LeftFooter = _
ActiveWorkbook.FullName

Regards,
Jim Cone
San Francisco, CA

"MICHAEL" wrote in message ...
I am trying to create a macros to enter the filepath in
the footer of an excel document. Here is what MS Office's
site said to create:
Sub UpdateFooter()
Sheet1.PageSetup.LeftFooter=
ActiveWorkbook.FullName
End Sub
When I do this I get a compile error expected:expression.
What am I doing wrong?

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
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Compile error in hidden module error Melissa Zebrowski Excel Programming 3 February 20th 04 01:29 PM
Debug/Compile: Compilng excel macros? What it generates? faustino Dina Excel Programming 4 August 1st 03 07:11 PM


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