+ Reply to Thread
Results 1 to 5 of 5

No VB Skills & "Invalid outside call" Error with Excel Import

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    Alexandria, VA USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question No VB Skills & "Invalid outside call" Error with Excel Import

    Hi All. I miss when I could simply have the appplication record my steps and save it as a macro. I sure wish Big Brother Bill had left in something like "Lower level programming for non-programmers." . . . I can pick my way through reading basic VB, but I've learned I'm not going to be a programmer. "Can't put in what God (or genitics) left out." So when it barfs, I usually don't know why.

    I'm trying to use Ken's code (http://www.accessmvp.com/kdsnell/EXCEL_Import.htm ) to create a macro to import an Excel file to an Access table. I've created a module named "M_API" with the Getz code. I created a module with Ken's "Browse to a single EXCEL File and Import Data from that EXCEL File via TransferSpreadsheet (VBA)" named "M1_Import_EDW" Then I created a macro named "M1_Import_EDW_Excel" to run the module.

    When I debug I get the "Invalid outside call" error on: blnHasFieldNames = True

    I must be missing something really basic as this code has been around for a long time. But I have no idea what. I get the same error Getz's code.

    TIA

    Ron

  2. #2
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: No VB Skills & "Invalid outside call" Error with Excel Import

    You're just setting a variable's value in that line, I am not sure why you would get that error. Maybe someone who has used this will have some insight...
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  3. #3
    Registered User
    Join Date
    08-03-2011
    Location
    Alexandria, VA USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: No VB Skills & "Invalid outside call" Error with Excel Import

    Thanks Hawkeye, I "thought" I understood the Dim, but . . . appriciate the comment.

    R

  4. #4
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: No VB Skills & "Invalid outside call" Error with Excel Import

    The line you typed above is separate of the DIM line.

    The DIM is just telling the program what kind of information the variable is going to hold. If you do not DIM something it can be a variant and hold many different types of information (depending on what you set it equal to) but it can cause errors if you are not careful so defining it at the start is a better approach.

    In this case it is set as a Boolean which can take True or False, which is what the line you are getting the error on is doing, trying to set the value of the boolean variable.

  5. #5
    Registered User
    Join Date
    08-03-2011
    Location
    Alexandria, VA USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: No VB Skills & "Invalid outside call" Error with Excel Import

    Sorry, my poor communications. However your explanation is the best I have read! I was making a poor joke of my limited skills and what little I do know: Dim blnHasFieldNames As Boolean

    Which I set as "True" per the comment:
    ' Change this next line to True if the first row in EXCEL worksheet
    ' has field names

    An example of what I can read but not program on my own.

    R

+ 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. Run-time Error 5 "Invalid Procedure Call or Argument"
    By dinakar.yadav in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2014, 09:22 AM
  2. WritetoSheet causing "invalid procedure call or argument"
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2013, 03:46 PM
  3. "Invalid Call or Argument" in While Loop using MyFile = Dir
    By rogerdavid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2013, 02:18 AM
  4. "Invalid procedure call or argument" error when creating Pivot table
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2009, 06:02 AM
  5. Get "error 1327 Invalid drive" when openning ms excel 2000
    By mikeworrell in forum Excel General
    Replies: 1
    Last Post: 02-27-2007, 03:52 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