Excel"s fullname property with OneDrive

Cover Image for Excel"s fullname property with OneDrive
Matheus Mello
Matheus Mello
published a few days ago. updated a few hours ago

Excel's Fullname Property with OneDrive: Solving the "https" Dilemma πŸ“šπŸ’»πŸ”—

So, you've saved an Excel file to your beloved OneDrive, but when you try to retrieve its full name using the open Workbook object, you encounter a little hiccup. Instead of receiving a local file path, you get a dreaded "https" address, which causes other programs to scratch their heads in confusion. 😱

But fret not! In this blog post, we'll dive into this common issue and provide you with easy solutions to get the local filename you crave. Let's get started and banish those "https" blues! πŸ™Œ

Understanding the Problem πŸ”

When you save a file to your OneDrive and it undergoes synchronization, the file's properties change, including the FullName property. Instead of returning the traditional local file path, it now presents a web URL starting with "https". 🌐

This URL format poses a problem for other programs that can't interpret it, leaving you with a headache and an unfulfilled desire for the local filename. πŸ˜“

Solution 1: Using the Scripting.FileSystemObject πŸ“‚πŸ”

One simple solution involves leveraging the power of the Scripting.FileSystemObject in VBA. By utilizing this handy object, we can retrieve the local file path even after synchronization with OneDrive. πŸš€

Here's a snippet of code to achieve this:

Sub GetLocalFileName()
    Dim objFSO As Object
    Dim strFullName As String
    Dim strLocalFileName As String
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    ' Prompt the user to select the file
    strFullName = Application.GetOpenFilename()
    
    ' Use the FileSystemObject to get the local file name
    strLocalFileName = objFSO.GetFile(strFullName).ShortPath
    
    ' Print the local file name in the Immediate Window
    Debug.Print strLocalFileName
End Sub

By utilizing the ShortPath property of the File object returned by GetFile, we can obtain the local filename even when dealing with OneDrive-synchronized files. πŸŽ‰

Solution 2: Mapping OneDrive as a Network Drive πŸ—ΊοΈπŸ–₯️

Another alternative is to map your OneDrive folder as a network drive on your computer. This process allows you to access the files using traditional file paths and avoids the "https" confusion altogether. 🌈

To map OneDrive as a network drive, follow these steps:

  1. Open File Explorer on your computer.

  2. Click on "This PC" or "My Computer."

  3. Select the "Map network drive" option from the toolbar.

  4. Specify the drive letter you want to assign to OneDrive.

  5. In the "Folder" field, enter the URL of your OneDrive folder (e.g., https://onedrive.live.com/...).

  6. Check the "Connect using different credentials" box if required.

  7. Click "Finish" and follow any additional prompts to complete the mapping process.

Voila! 🎊 You can now access your synchronized OneDrive files using their local file paths through the network drive you just created.

Call-to-Action: Join the Conversation! πŸ’¬πŸ“£

We hope this article helped you tackle the notorious "https" issue when retrieving the local filename of a OneDrive-synchronized Excel file. Now it's your turn to share your thoughts and experiences!

πŸ‘‰ Have you faced this problem before? How did you solve it? πŸ‘‰ Do you have any alternative solutions or tips to add? πŸ‘‰ Is there a particular Excel topic or problem you'd like us to cover next?

Join the conversation below and let's make Excel with OneDrive more enjoyable for everyone! πŸš€πŸ“ˆ

Happy Excel-ing! πŸ˜„βœ¨


More Stories

Cover Image for How can I echo a newline in a batch file?

How can I echo a newline in a batch file?

updated a few hours ago
batch-filenewlinewindows

πŸ”₯ πŸ’» πŸ†’ Title: "Getting a Fresh Start: How to Echo a Newline in a Batch File" Introduction: Hey there, tech enthusiasts! Have you ever found yourself in a sticky situation with your batch file output? We've got your back! In this exciting blog post, we

Matheus Mello
Matheus Mello
Cover Image for How do I run Redis on Windows?

How do I run Redis on Windows?

updated a few hours ago
rediswindows

# Running Redis on Windows: Easy Solutions for Redis Enthusiasts! πŸš€ Redis is a powerful and popular in-memory data structure store that offers blazing-fast performance and versatility. However, if you're a Windows user, you might have stumbled upon the c

Matheus Mello
Matheus Mello
Cover Image for Best way to strip punctuation from a string

Best way to strip punctuation from a string

updated a few hours ago
punctuationpythonstring

# The Art of Stripping Punctuation: Simplifying Your Strings πŸ’₯βœ‚οΈ Are you tired of dealing with pesky punctuation marks that cause chaos in your strings? Have no fear, for we have a solution that will strip those buggers away and leave your texts clean an

Matheus Mello
Matheus Mello
Cover Image for Purge or recreate a Ruby on Rails database

Purge or recreate a Ruby on Rails database

updated a few hours ago
rakeruby-on-railsruby-on-rails-3

# Purge or Recreate a Ruby on Rails Database: A Simple Guide πŸš€ So, you have a Ruby on Rails database that's full of data, and you're now considering deleting everything and starting from scratch. Should you purge the database or recreate it? πŸ€” Well, my

Matheus Mello
Matheus Mello