+ Reply to Thread
Results 1 to 2 of 2

Recorded a Macro to import Data: having troubles getting macro to work after first time

  1. #1
    Registered User
    Join Date
    05-14-2019
    Location
    Calgary, AB
    MS-Off Ver
    2017
    Posts
    1

    Question Recorded a Macro to import Data: having troubles getting macro to work after first time

    Hi there. Excuse me if this thread already exists, I just wasn't able to find a solution quite like I needed.

    Essentially, I want to record a macro that when you press a command button, It imports data from an external excel file that has constantly changing data (essentially a new file is downloaded every single week with different data and renamed to fit the name with which the code is configured around so it'll work with the macro). What I recorded doing is importing data from an excel file and loading it to the current worksheet. Then I stopped recording, and deleted all of the data imported (so the next time I open the file I can import new data). The problem is, when I reopen the file to test it and run the macro, I get a run time error that says query with this sheet name already exists. I'm new to VBA so I don't really understand what that means.

    Any help is appreciated!

    I would attach my code but it contains confidential information so please don't ask!

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    1,693

    Re: Recorded a Macro to import Data: having troubles getting macro to work after first tim

    Welcome to the Forum,

    1. Attach such an example macro (but change sensitive data in it to keep it confidential)
    2. Give the exact order of the activities you are doing

+ 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. Recorded macro - doesn`t work
    By Bandini in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2014, 02:20 AM
  2. [SOLVED] Nested IF recorded using macro does not work when run from VBA developer
    By lgass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2014, 11:18 AM
  3. Editing a recorded macro of a csv import error
    By jcmc2112 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2014, 09:24 AM
  4. Help! The recorded Macro does not work for the highlighted
    By lans_bazx in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 09-19-2012, 06:59 PM
  5. Recorded Macro Does Not Work
    By TheColorLavender in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2012, 01:56 AM
  6. Generalizing a recorded macro to import daily text file
    By excelVBAn00b in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2012, 05:36 PM
  7. How to alter a recorded macro to work better
    By antonymiller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2009, 02:53 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