Results 1 to 11 of 11
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Importing to excel when file is too large (2000 sp3)

    All,
    I found some code (did not catch the post number) but Steve submitted the code. Basically, it will grab the file, load the array, dump to spreadsheet, then continue loading on another sheet until done.

    What I would like to do is :

    1) load several text files, cycle through them all until done. They will always have the same file names (there are 6 files)
    2) After loading the files, name the sheets with the file name. If the file is spread over more than one sheet, add something to indicate sheet 2, 3 , 4 etc (along with the file name)

    Attached is the code in a text file.

    Thanks,
    Brad

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    Try the attached code. Steve's macro has been changed into a procedure that takes a filename as argument. Edit the ImportMultFiles macro as needed, then run it.

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    Hans,

    I tried the attached code that you supplied, however I get the following dialog Box:

    Argument Not optional.

    The code is in Module 1, if this matters. I supplied the original file with your updates....

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    It would help if you told us which line is highlighted when you get the error.

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    Hans,
    No line gets highlighted. The dialog pops up, I click on it and it goes away. Also, I had the VB editor up, and the error box popped up. I clicked on the box, and the editor closed. Not line was highlighted.

    Brad

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    Doesn't the error message dialog have a Debug button? Try clicking that. Else open the Visual Basic Editor and select Debug | Compile VBAProject. If there is an error message, a line should be highlighted in yellow.

  7. #7
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    Hans,
    The dialog does not have a debug button. I did try to use the debug / Compile however nothing highlighted.


    Brad

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    In the ImportMasher procedure in the ThisWorkbook module, change the line

    .OnAction = "ImportMultSheets"

    to

    .OnAction = "ImportMultFiles"

  9. #9
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    Hans,
    Still no luck. I imagine it is getting late over there, so I will keep working, and check back.

    Brad

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    You will have to save, close and reopen the workbook after that change.

  11. #11
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing to excel when file is too large (2000 sp3)

    I should have caught that.....

    [img]/forums/images/smilies/sad.gif[/img]

    Many thanks,
    Brad

Posting Permissions

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