Stata .do file runs on one computer but not another

This problem started when we ran the same .do file on different computers. The file worked on Computer 1 and not Computer 2. It gave them an error that the file was not found. However, we know it's there because the code ran fine on Computer 1. FWIW, the .do file runs in Stata 15 but not in Stata 13 on Computer 1. Computer 2 has Stata 15 but it won't run there.

Here's what we're using:

global data "~\Dropbox\folder1\folder2\folder3"

import excel using "$data\folder4\myfile.xlsx"

Gives me this error in Stata 13/Computer 1 and in Stata 15/Computer 2:

file ~\Dropbox\folder1\folder2\folder3\folder4\myfile.xlsx not found

But this command works on Computer 2:

import excel "C:\Users\myname\Dropbox\folder1\folder2\folder3\folder4\myfile.xlsx"

I manually changed the working directory to be sure it's correct, ran these commands, and still get the same "file not found" error.

What could be causing this? Thanks.