+ Reply to Thread
Results 1 to 7 of 7

VBA compiler suddenly requiring application. or worksheetfunction. expressions

  1. #1
    Registered User
    Join Date
    12-08-2017
    Location
    Minneapolis, MN
    MS-Off Ver
    Standard 2013
    Posts
    83

    VBA compiler suddenly requiring application. or worksheetfunction. expressions

    Does anybody know why this is the case?

    For instance, it usually takes for granted you're talking about the ActiveSheet but suddenly it required me to say Application.Activesheet or it wouldn't compile.

    today I found one of my simple convenience macros that trims a cell required me to specify Worksheetfunction. It would compile, it just wouldn't do anything.

    I don't know why and I guess that's what I'm asking, but I know when. it did happen shortly after I created a convenience macro to one click delete the active worksheet. I thought maybe this screwed up some logic in the system. Note it still requires this even the next day after rebooting and all that, so it definitely persists. I also added a reference library but that was after the fact. I added Microsoft Scripting Runtime. I think it has to do with the macro that deletes the active worksheet literally one line of code

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA compiler suddenly requiring application. or worksheetfunction. expressions

    Were I you, I would try repairing my Office
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA compiler suddenly requiring application. or worksheetfunction. expressions

    Hello foxtrotter,

    You could also try to clear the Excel Cache.

    Please see this Link
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VBA compiler suddenly requiring application. or worksheetfunction. expressions

    .
    He lives !!!

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA compiler suddenly requiring application. or worksheetfunction. expressions

    Quote Originally Posted by Logit View Post
    .
    He lives !!!
    Yeah, still as a human and not half android!

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

    Re: VBA compiler suddenly requiring application. or worksheetfunction. expressions

    Have you named a variable or procedure ActiveSheet?
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    12-08-2017
    Location
    Minneapolis, MN
    MS-Off Ver
    Standard 2013
    Posts
    83

    Re: VBA compiler suddenly requiring application. or worksheetfunction. expressions

    Not sure. I haven't thought about this lately but it's still something I'm curious about, for later. As a best practice, I've been typing out the full expression for everything (e.g. application.activeworkbook..). Who knows what will happen on someone's local machine at some point, but this is something I'll come back to if I ever get a chance.

    VBA is deeper than you thought. It's obviously not a hardcore language like C++ or whatever, but it goes deeper and deeper. I'm constantly learning new things it can do.

+ 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. [SOLVED] using application.WorkSheetFunction. in code
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-22-2017, 06:09 AM
  2. Application.WorksheetFunction.Match in VBA
    By karen53 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-24-2014, 06:32 PM
  3. [SOLVED] Application.WorksheetFunction vs Application.NormDist
    By Boo123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2014, 06:33 PM
  4. [SOLVED] Excel Table Requiring Blank Row For Expressions To Work
    By jcaynes in forum Excel General
    Replies: 6
    Last Post: 09-09-2013, 06:54 PM
  5. Application, WorksheetFunction or both?
    By Benni in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2012, 08:59 PM
  6. Application.WorksheetFunction
    By roger09 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2011, 09:07 AM
  7. [SOLVED] application.worksheetfunction
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2006, 03:15 AM

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