Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:15:59+00:00 2026-06-07T20:15:59+00:00

Quick Background: I write excel macros for a company that uses shared drives on

  • 0

Quick Background: I write excel macros for a company that uses shared drives on the network to share information between employees

The Problem: Different employees have the same shared drive listed under separate letters. For example Susie has the “Commissions Shared Drive” as drive “Z” but Betty has it as drive “x”.

I’ll design a macro that two different people use and the macro runs into errors because they have separate drive letters. To put it simply, the file locations written in the code won’t be correct for both people due to the difference of drive letter.

The Current Solution: I currently have a copy of the exact same macro with changes made to the file locations to account for the difference of drive letter. This is annoying because anytime I make changes to the one file I have to ensure the other is exactly the same.

The Question: Is there a way I can account for different drive letters in one macro so I don’t have to have duplicates of the file with different addresses?

Thanks in Advance!

-Mike

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:16:01+00:00Added an answer on June 7, 2026 at 8:16 pm

    Use the actual network path.

    For instance instead of something like

    Z:\filename
    

    Use

    \\servername\foldername\filename
    

    As long as the user has access to the path, the code will find it regardless of drive mapping.

    Edit:
    You can view this question and its answers for some great reasons why you should not use the mapped drive letters in your code.
    As a side note, if you were using something less updatable then an Excel macro, it would be a good idea to not actually store the path in your code at all. Instead you would have a file that the code views to obtain the path. Thereby what you write will work far longer without having to be recompiled or revised. But again, since you’re just doing an Excel macro I see no compelling reason not to use the direct path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So the quick background is I am creating a java program, that uses many
Here's the quick background: I've got a client and a server program that are
Quick background I have a concurrent map I used to cache some values that
So the quick background is that I have a page listing a set of
Quick background: I'm programming in PHP, I have a domain model with a separate
this is my first question on stack overflow. Some quick background, this is not
Quick question, has anyone done a benchmark on random number generation between javascript and
Quick background I'm a Java developer who's been playing around with C++ in my
Quick background for those interested, I have a master detail table(options date), about 20
A quick question: Does IE 6,7 support the css of background-color:inherit; ? for example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.