+ Reply to Thread
Results 1 to 5 of 5

syntax error with Expected:= error

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    syntax error with Expected:= error

    I was pointed in a direction on what I could change in my code that I have been working on but with the changes I am getting 2 different errors. The errors I am receiving are the following, One error is a compile error: syntax error and the other is compile error: Expected:=.

    This is the code I am working with right now. The coding in red is my issue I think
    Please Login or Register  to view this content.
    This is the original code, the code in blue is what I cut out
    Please Login or Register  to view this content.

    This is the code that I pasted in.
    Please Login or Register  to view this content.
    I don't think IterateFolders is defined. I am confused.

    Thanks for the help.

  2. #2
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: syntax error with Expected:= error

    Use parameters without parentheses

    Wrong:
    Please Login or Register  to view this content.
    Correct:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: syntax error with Expected:= error

    Ok I change what was suggested and now I am coming up with a different error.
    Please Login or Register  to view this content.
    Compile error:
    Expected Sub, Function, or Property

    This is having IterateFolders as a String, but when I change it to an Object the error changes to

    Compile error:
    Expected End Sub
    At this line of code
    Please Login or Register  to view this content.
    I wish I had a better grasp at VBA.

  4. #4
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: syntax error with Expected:= error

    I have tried looking up other methods and still not getting anywhere. Am I missing something simple?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: syntax error with Expected:= error

    As your code is written, IterateFolders is a procedure. Did you write a procedure by that name?
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  2. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  3. [SOLVED] Compile Error: Expected Expression, Syntax Error
    By gjohn282 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 11:28 PM
  4. Syntax Error and Compile Error: Expected Line Number or Label...
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-31-2011, 09:59 AM
  5. VBA compilation error : expected expression error
    By raknahs in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2010, 12:57 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1