Compile Error

E

erexkiss

Version: 2004
Processor: Intel

Hello all,

I have written some macros on PC for excel, and am trying to open and run them in MAC Office 2004. I know that Office 2008 doesnt support macros, so that is why i am trying on Mac OFfice 2004. I open the excel file and i get the 'Compile Error' message when trying to run a macro.

Here is the code for the macro: (sorry about the stuff in Hungarian)

Sub add_mds_sheet()

If is_sheet_exists("MDS") Then
MsgBox "Existing MDS sheet will be recreated!"
delete_sheet ("MDS")
End If

Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "MDS"
Sheets("MDS").Select
Columns("A:D").ColumnWidth = 1.15
Rows("1:1").RowHeight = 15
Rows("2:2").RowHeight = 30
Range("E2").Value = "MASTER DELIVERY SCHEDULE"



'fejléc átmásolása az Information lapról
Range("heading").Copy
Range("E5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteColumnWidths

'Innen kezdődik majd a feltöltés, megjegyzi a helyét
ActiveCell.Offset(1, 0).Select
r = ActiveCell.Row
c = ActiveCell.Column
Call start_process

End Sub
Sub format_mds_sheet()

Sheets("MDS").Select
Range("E2:I2").Select

Selection.Merge
With Selection
.Font.Bold = True
.Font.Size = 16
.Font.ColorIndex = Range("titles_color").Font.ColorIndex
.Interior.ColorIndex = Range("titles_color").Interior.ColorIndex
.Interior.Pattern = xlSolid
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With

Range("E5").Select
Selection.AutoFilter

With ActiveSheet.PageSetup
.PrintTitleRows = "$2:$5"
.LeftHeader = ""
.CenterHeader = "&A"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "&P"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.393700787401575)
.RightMargin = Application.InchesToPoints(0.393700787401575)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.393700787401575)
.FooterMargin = Application.InchesToPoints(0.393700787401575)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1
ActiveWindow.View = xlNormalView

'Oszlopok adatainak középre igazítása
Range("K:K,N:T").Select
Selection.HorizontalAlignment = xlCenter

'Vékony szegély az egészre
Range("E5").CurrentRegion.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
 
J

JE McGimpsey

I have written some macros on PC for excel, and am trying to open and run
them in MAC Office 2004. I know that Office 2008 doesnt support macros, so
that is why i am trying on Mac OFfice 2004. I open the excel file and i get
the 'Compile Error' message when trying to run a macro.

Since you didn't say what the Compile Error: message said (or which line
was highlighted in debug mode), it's hard to be sure.

The only thing I saw for sure is that the Page Setup.PrintErrors
property doesn't exist in VBA5 (WinXL97 and all MacXL versions).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top