Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Compatibility

I have a macro created in Excel 97/Windows 98. The macro
formats a document (font, size, margins, etc.) then allows
for a save as a .pdf. We have recently upgraded to Excel
2002/Windows XP and now the macro will not run.
The error it gives says the font is not compatible.
Courier New is the font.
Rumor is that macros created in older versions will not
run on 2002 with XP.
Does anyone know anything about this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro Compatibility

I don't have xl2002 handy, but the Font part of your code works OK in xl2000
as well. Excel 2002 added finer granularity in controlling what is allowed
when a sheet is protected. Perhaps, unless specifically allowed, changing
the font is no longer allowed. Did you try doing it manually with the sheet
protected?

I suspect this has more to do with a change in the way Excel itself operates
than anything to do with macro differences.

Move you Protect line of code below the formatting instructions and you
should be good to go if the sheet isn't already protected.

--
Regards,
Tom Ogilvy



"M.Vance" wrote in message
...
I checked the Tools=References and it looks the same.
Here is the error I get when I try to run it then the
line of code it highlights when I debug.

Run time error'1004':
Unable to set the Name property of the Font class.

Error that is highlighted:
.Name = "Courier New"

Here is the macro also:
Cells.Select
ActiveSheet.Protect DrawingObjects:=False,
Contents:=True, Scenarios:=True
With Selection.Font
.Name = "Courier New"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Rows("9:9").Select
ActiveWindow.FreezePanes = True
' Columns("A:A").Select
' Selection.Columns.AutoFit
' Range("A1:A8").Select
' With Selection.Interior
' .ColorIndex = 15
' .Pattern = xlSolid
' End With
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$8"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = " Printed Copies For Reference
Only"
.CenterFooter = "Page &P of &N"
.RightFooter = " &d
&t"
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
Rem .PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
End Sub

Thanks

-----Original Message-----
Macros should run fine. After the error, go into the

VBE and look in
Tools=References (with your workbook as the active

project) and see if any
reference is marked as MISSING. If so, that means that

excel can't find
that reference. Select it and browse for the latest

version or unselect it
if you are not using it in your program.

This is just a guess as to the cause. If you are using

an addin from Adobe,
then this could be causing the problem - I can't say.

But most macros written in xl97 (using only built in

VBA/Excel methods,
procedures and functions) should work without

modification in xl2002.
--
Regards,
Tom Ogilvy


"M.Vance" wrote in message
...
I have a macro created in Excel 97/Windows 98. The

macro
formats a document (font, size, margins, etc.) then

allows
for a save as a .pdf. We have recently upgraded to

Excel
2002/Windows XP and now the macro will not run.
The error it gives says the font is not compatible.
Courier New is the font.
Rumor is that macros created in older versions will not
run on 2002 with XP.
Does anyone know anything about this?



.



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
Compatibility Robert Links and Linking in Excel 4 May 27th 10 04:51 PM
COMPATIBILITY Leon Excel Discussion (Misc queries) 1 March 11th 08 10:15 AM
Testing Reverse Compatibility and Compatibility in General dim Excel Discussion (Misc queries) 4 January 8th 08 01:02 PM
Compatibility Simon Hollingshead Excel Discussion (Misc queries) 1 February 5th 06 01:14 PM
URGENT Mac/PC macro compatibility problem marika1981 Excel Discussion (Misc queries) 7 January 8th 05 12:43 AM


All times are GMT +1. The time now is 05:42 AM.

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"