Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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??

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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?

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you by any chance install Office 2010 beta on your system?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    The Beta should be OK, I think - it was the Tech Preview that overwrote the VBA dll as best I recall?
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, you're right.

    I think there is a corruption somewhere though.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    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).
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •