+ Reply to Thread
Results 1 to 13 of 13

Pulling data from network location to import

  1. #1
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Pulling data from network location to import

    I'm having an issue with some read only data that needs to be pulled from a CSV file on a remote server and importing that data into the workbook I need it to be on (Local machine).

    This is not a SQL server.

    Currently through the local machine, I have to map the network drive to have local access to the server. Once I have the network drive mapped, I'm able to pull the information through the data-> from text tab in excel, which functions perfectly. The problem i'm having is if another user (2) who doesn't have the network drive mapped to the same drive as I do (User 1) (Drive is mapped to Z for user 1, drive is disconnected/mapped to Y for user 2)

    I've gone through the data connection wizard and it does not provide me with an option to connect to the remote server directly. Is there any easy way to connect the workbook to the remote server to pull read only data permanently?

    I'm currently using Excel 2007 (User 2) and Excel 2013 (User 1)

    Thanks.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Pulling data from network location to import

    If they have permissions to access the network folder you have mapped as a network drive, just use the 'fully-qualified-domain-name' instead of the mapped drive letter for your links.


    For example, instead of : 'X:\MyFolder\[MyFile.xlsm]mysheet'!

    Use: '\\compName\MyFolder\[MyFile.xlsm]mysheet'!
    Last edited by GeneralDisarray; 07-28-2015 at 10:00 AM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    And does the drive HAVE to be mapped on the local machine, or is there a way to tell excel "Hey, this is the webserver 192.168.1.200" and this will never change, pull all information from this IP address"?

  4. #4
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    The users should have permissions, perhaps that was the issue was I wasn't using a FQDN and the user may not have had permission.

    Let me look into this and see if this works!

    Thanks for your reply!

  5. #5
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Pulling data from network location to import

    Quote Originally Posted by amorshc View Post
    And does the drive HAVE to be mapped on the local machine, or is there a way to tell excel "Hey, this is the webserver 192.168.1.200" and this will never change, pull all information from this IP address"?
    Yes - you can do that. I usually have used \\computerName instead of the IP address, but I believe this will work just the same: \\192.168.1.200


    Example:
    ='\\IP_ADDRESS\Folder_Path\[FileName.xlsm]Sheet1'!$A$1
    Last edited by GeneralDisarray; 07-28-2015 at 10:40 AM.

  6. #6
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    @GeneralDisarray

    The user has permissions, however they must use a username/password to access the shared file. If I go to the connection properties, saving the password and authentication settings are all grayed out. This shows me that using the mapped drive or FQDN still require that drive to be mapped to the local machine. Is there a way to have the username/password saved in the workbook (this is just raw data that needs to be input and organized into the local workbook I have), so security is not any big risk.

    The local workbook is not locked, or restricted for editing at all, and the server with raw data has 1 username and 1 password (Same for all users who access this information)

    Thanks!

  7. #7
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    I'm still having no luck importing the data from remote server without having the drive mapped for the username/password.

    If anyone knows how to have excel pull the remote server info \\computername\server\file.csv and have a username/password to the source without having to map the drive, please let me know.

    Thanks!

  8. #8
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Pulling data from network location to import

    Hey there... thought I posted this earlier.

    I have an alternative solution, but I'm not sure you will like it because it goes another way.

    First, let me make sure I understand. They have read/write permissions to the files on that drive - but you have locked the single workbook with a username password? If that is the case, why is that locked?


    If you answer is, 'so they don't mess with it', then I would suggest this alternative:

    Insert this macro into a code module:

    Please Login or Register  to view this content.
    Insert this macro, into the 'ThisWorkbook' code module:

    Option Explicit

    Please Login or Register  to view this content.

    What will happen is, the user will open the book you want them to use - and will be asked: ""Refresh from CSV?" - IF they answer Yes, the refresh will happen 'under the hood' - meaning they will have no idea where the file is located on the network - so you can leave it unlocked and just squirrel it away somewhere.

    If they answer no, no update will happen. This is just an example you could have the refresh launched in other ways. I just see that you have a problem that the usual ribbon-based solution is not solving - so me personally, I would just use a macro to have absolute control over what I want w/o any unfortunate limitations.

    :D


    EDIT:

    Note - I've tested this out and for some reason I do indeed have to use the computer name in the macro solution, instead of the IP address.

    That is generally a good idea anyway IMO - computer names are less likely to change
    Last edited by GeneralDisarray; 07-28-2015 at 04:24 PM.

  9. #9
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Pulling data from network location to import

    You can modify and test out the attached example.

    Note: upon open, enable the content, and answer "no" to the question. Then press alt+F11 and edit the 'ThisWorkbook' code module (meaning, expand excel objects in the project explorer, right click on the object named "ThisWorkbook" and select option View Code).
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    Hi!

    Thanks for the reply, i've been tearing my head out with no avail looking everywhere for some answer (And i've come to the conclusion that its not possible without mapping the drive).

    The remote server that currently holds the CSV files is a remote server which requires a username and password to connect to (we have access to this server, but before the excel file i've created, we would have to login to the remote server via RDP, open the CSV file and pull the raw data from the CSV file and input that information to a worksheet.).

    The alternative way of doing this was to map the network drive to the local machine and check the remember credentials box, so the drive was always connected to the local machines here in the network. This created a simpler way of opening the CSV files, and copying them to a worksheet.

    The workbook I created eliminated all steps above, when the network drive was mapped to the correct letter, but as I previously mentioned, if the network drive was incorrectly mapped it was throwing an error (This was fixed by using the actual \\server\folder\file.csv information) However if I disconnect the mapped network drive, I no longer have access to those files.

    The question I have was, if a user does not have a network drive mapped to their computer, via EXCEL how can I have the workbook pull the network location \\server\folder\file.csv and login with a username/password to the remote server and have that information automatic. The information i'm pulling is updated every 30 minutes, and so if a user opens my workbook, the information should refresh if it can view the remote server.

    I hope that makes sense?

  11. #11
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    Quote Originally Posted by GeneralDisarray View Post
    Hey there... thought I posted this earlier.

    I have an alternative solution, but I'm not sure you will like it because it goes another way.

    First, let me make sure I understand. They have read/write permissions to the files on that drive - but you have locked the single workbook with a username password? If that is the case, why is that locked?


    If you answer is, 'so they don't mess with it', then I would suggest this alternative:

    Insert this macro into a code module:

    Please Login or Register  to view this content.
    Insert this macro, into the 'ThisWorkbook' code module:

    Option Explicit

    Please Login or Register  to view this content.

    What will happen is, the user will open the book you want them to use - and will be asked: ""Refresh from CSV?" - IF they answer Yes, the refresh will happen 'under the hood' - meaning they will have no idea where the file is located on the network - so you can leave it unlocked and just squirrel it away somewhere.

    If they answer no, no update will happen. This is just an example you could have the refresh launched in other ways. I just see that you have a problem that the usual ribbon-based solution is not solving - so me personally, I would just use a macro to have absolute control over what I want w/o any unfortunate limitations.

    :D


    EDIT:

    Note - I've tested this out and for some reason I do indeed have to use the computer name in the macro solution, instead of the IP address.

    That is generally a good idea anyway IMO - computer names are less likely to change


    I currently have the refresh happening under the hood - the file is not locked, the only part that requires a username and password is the access of the file on the remote server, as explained below. I've tried messing with some macros to login under a username and password to pull a file, but they don't seem to work well with the network address I have (As its a remote server)

    P.S.

    Thanks for all of your help! I appreciate you taking time to reply to me.
    Last edited by amorshc; 07-28-2015 at 04:45 PM. Reason: Thanks!

  12. #12
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Pulling data from network location to import

    ah ha! That's interesting. Yes, having to 'credential in' is going to hamper this kind of thing. Sounds like your company is handle things differently than I'm used to. Do you guys log into the domain (like with user specific active directory credentials) or with a generic login on non-domain computer?

  13. #13
    Registered User
    Join Date
    03-27-2015
    Location
    los angeles
    MS-Off Ver
    2013
    Posts
    40

    Re: Pulling data from network location to import

    Quite! For the local computer we have a generic login on non-domain computer. To access the server with the information we need to login to the domain that server is on (Either mapping the drive, or via RDP).

    Kinda sucks, but as I said, the way I have it working currently is just to map the drive on the local computer, and have the information pulled. I'm trying to simplify this for the non-technical users in our group who wouldn't know what a mapped network drive is, nor how to make that happen.

    lol.

+ 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. Replies: 0
    Last Post: 04-16-2013, 10:27 AM
  2. Change Import Data file location?
    By pingwin77 in forum Excel General
    Replies: 0
    Last Post: 11-01-2012, 02:28 PM
  3. Reading data from network location and writing to some in memeory structure
    By June2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2011, 02:59 AM
  4. Changing path to a network location
    By talksalot81 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2011, 12:10 PM
  5. Replies: 2
    Last Post: 02-27-2009, 02:01 PM
  6. [SOLVED] Shared Template on a Network Location
    By cLiffordiL in forum Excel General
    Replies: 6
    Last Post: 08-07-2006, 11:10 AM
  7. Best practices for pulling data from a network Excel file (mult users)
    By KR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2006, 03:45 PM
  8. [SOLVED] Import External Data Source File Location Changed
    By Louise in forum Excel General
    Replies: 3
    Last Post: 01-04-2006, 10:50 AM

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