+ Reply to Thread
Results 1 to 8 of 8

Compile error: Type mismatch

  1. #1
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Compile error: Type mismatch

    Greetings all

    I am trying to set a workbook variable and keep getting a Compile error: Type mismatch. I just don't see what I am doing wrong.

    Please Login or Register  to view this content.
    Pretty sure this is going to be one of those 'Duh!' kind of moments, but right now it is a brick wall.

    Thanks for looking
    Last edited by jacob@thepenpoint; 07-10-2014 at 09:35 AM.
    Jacob Albers
    Excel 2003 & 2010

  2. #2
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Compile error: Type mismatch

    Please Login or Register  to view this content.
    as it is now wb is a variant
    and this line is wrong

    Please Login or Register  to view this content.
    needs to be a workbook name as object

  3. #3
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Compile error: Type mismatch

    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Compile error: Type mismatch

    Thanks AB33

    I made the change yet I am still getting the same error. I should have pointed this out the first time but the debugger highlights just the "net margin export ready v1.1.xls" when it gives me the compile error.

  5. #5
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Compile error: Type mismatch

    "net margin export ready v1.1.xls" is string, not an object which is probably the name of the workbook. Try #3

  6. #6
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Compile error: Type mismatch

    Thanks AB33

    As I said earlier, it was a 'Duh!' moment. Once I added 'Workbooks' it worked perfectly!

    Thanks again!

  7. #7
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Compile error: Type mismatch

    Thanks Olly!

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compile error: Type mismatch

    Maybe:

    Please Login or Register  to view this content.

+ 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. Compile Error - Type Mismatch
    By Will B in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2012, 11:17 AM
  2. Complile Error: Type Mismatch ??? After adding error trap
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2012, 03:50 PM
  3. Adding Header via Add-In - Compile error: Type Mismatch
    By koticphreak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-01-2009, 12:13 PM
  4. Compile Error - Type Mismatch in VBA
    By Hotmail in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2009, 01:05 AM
  5. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM

Tags for this Thread

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