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

  • SEARCH
  • Home
  • 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 7097823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T10:59:00+00:00 2026-05-28T10:59:00+00:00

I have a macro-enabled worksheet that resides in a shared location on my PC.

  • 0

I have a macro-enabled worksheet that resides in a shared location on my PC. This sheet, used to collect some data from employees resides in a shared location in network. It has a feature where users are sent reminder mails when they fail to fill data in time. In the mail content I like to add the local network path to my excel file.

I accomplish this by adding the code

“You can access the tool from the location " & ThisWorkbook.FullName

On sending mails using this code I get the path to this folder as C:\Users\XYZ\Hello.xlsm
I would like to send the network path with IP address so that users can directly copy the path into run and access the file.

Interesting thing is that if I send the mail from another system other than mine by accessing the file form my shared folder, the mail is sent with the network path. Can anyone help on this?

I use Excel 2007

  • 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-05-28T10:59:00+00:00Added an answer on May 28, 2026 at 10:59 am

    I partially solved my problem. I used a function to find the computer name and manipulated ThisWorkbook.Fullname

    Private Declare Function GetComputerName Lib "kernel32" _
        Alias "GetComputerNameA" _
        (ByVal lpBuffer As String, nSize As Long) As Long
    
    Function ReturnComputerName() As String
        Dim rString As String * 255, sLen As Long, tString As String
        tString = ""
        On Error Resume Next
        sLen = GetComputerName(rString, 255)
        sLen = InStr(1, rString, Chr(0))
        If sLen > 0 Then
            tString = Left(rString, sLen - 1)
        Else
            tString = rString
        End If
        On Error GoTo 0
        ReturnComputerName = UCase(Trim(tString))
    End Function    
    
    
    Sub GetThePath()
        If Left(ThisWorkbook.FullName, 2) <> "\\" Then
            If Sheet4.Range("B15").Value = "No" Then
                CN = "file:\\" & Evaluate("=ReturnComputerName()") & "\"
            End If
            mynames = ThisWorkbook.Path
            mynamesa = Split(mynames, "\")
            elem = UBound(mynamesa)
            mynames = mynamesa(elem)
            mynames = mynames & "\" & ThisWorkbook.Name
            mynames = CN & mynames
        ElseIf Left(ThisWorkbook.FullName, 2) = "\\" Then
            mynames = ThisWorkbook.FullName
        End If
    End Sub
    

    Demerit: Cannot find the correct path if the file is in a folder within a shared folder.

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

Sidebar

Related Questions

I have a shared macro-enabled workbook used to conduct quiz. I have the option
I have a macro that looks like this: #define coutError if (VERBOSITY_SETTING >= VERBOSITY_ERROR)
I have an access macro, that I want to run automatically from a batch
I have created a macro enabled Excel Spreadsheet that will programmatically load a image
I have a macro enabled template with an event listener that listens for content
I have macro that populates a sheet, and copies values into a grid. I
I'm kinda stuck with this task. I have a macro that retrieve two ranges
I currently have this: #define THIS(T) (boost::static_pointer_cast<T>(shared_from_this())) The macro is used in a method
I have a macro that I wrote to just help me with my unit
I have a macro definition in header file like this: // header.h ARRAY_SZ(a) =

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.