• Macros issues in 2007

    Author
    Topic
    #464769

    I created a macro in 2007 (it works in 2003). Simply macro to create a template for a class exercise. After creating in 2007, I ried to run it and I get some errors messages. Below is the code (I copied only a small portion). The lines with the . = are in red and this is causing the macro to error out. I get a syntax error message. The first line – click on cell A3, enter the funtion =NOW() and then change the formatting to be month, day, and year. Nothing fancy….

    Here is a few lines of my code:

    Range(“A3”).Start
    . = “=NOW()”
    Range(“A3”).Start
    .Borders = “[$-409]mmmm d, yyyy;@”
    Range(“A1”).Start
    . = “ABC COMPANY”
    Range(“A2”).Start
    . = “Quarterly Report”
    Range(“A6”).Start
    . = “Region”
    Range(“A7”).Start
    . = “North”
    Range(“A8”).Start
    . = “East”
    Range(“A9”).Start
    . = “South”
    Range(“A10”).Start
    . = “West”
    Range(“A12”).Start
    . = “Total Sales”
    Range(“B6”).Start
    . = “Sales “&chr(10)&”Amount”
    With .Alignment(ErrorString := 1, Native := 13).
    .Interior = “Calibri”
    . = “Regular”
    . = 11
    . = FALSE
    . = FALSE
    . = FALSE
    . = FALSE
    .RectangleBottom = False

    It seems as if my VBA editor is slicing my code. I am getting a lot of RED and sytax message. Is there something in 2007 I need to do to get my macros to work. I have class this week and I need to cover macros.

    Can anyone help??

    Viewing 4 reply threads
    Author
    Replies
    • #1191191

      Your code seems to have become seriously corrupt. For example, in

      Range(“A3”).Start
      . = “=NOW()”

      Start is not a property or method of a range in Excel, and the second line is incomplete. Do you have access to a computer with Excel 2003 so that you can retrieve the original code?

    • #1191193

      Did you by any chance install Office 2010 beta on your system?

    • #1191202

      The Beta should be OK, I think – it was the Tech Preview that overwrote the VBA dll as best I recall?

    • #1191412

      Yes, you’re right.

      I think there is a corruption somewhere though.

    • #1191415

      Yep! It almost looks as though the recorder has got confused between Word and Excel (since Start is a property of a Word Range I think).

    Viewing 4 reply threads
    Reply To: Macros issues in 2007

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: