Refresh Show Error : Web Content Failed To Get Contents..

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,102
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all...
in the several days my dashboard is as well but today since i refresh my excel sheet into dropbox, show message '
batam
Web.Contents failed to get contents from 'https://www.dropbox.com/s/dl/6f28pq3sw2k18sm/KPKNL BATAM 2022.xlsx' (404): Not Found'
i'm using Excel 2021, power bi desktop

how to fix the problem?
my excel file ever renaming but today is back to original file name
why still error, can't refreshing data.

maybe someone give me a solution.
thank in advance
susant
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try adding the ?dl=1 at the end of the source URL as shown below in order to download the file:

https://www.dropbox.com/s/dl/6f28pq3sw2k18sm/KPKNL BATAM 2022.xlsx?dl=1

So, the function will look like below in Power Query:
Power Query:
Web.Contents("https://www.dropbox.com/s/dl/6f28pq3sw2k18sm/KPKNL BATAM 2022.xlsx?dl=1")
 
Upvote 0
Hello man, i will try with your tricks, thanks a lot. A long time waiting this solutions, i hope this work for me.
 
Upvote 0
Hello man, i will try with your tricks, thanks a lot. A long time waiting this solutions, i hope this work for me.
It is not a trick actually. When dl query parameter is 0 or not provided then DropBox returns the response as it will return to the browser to let the browser to open the file if possible. On the other hand, dl=1 means "forced download", and that's why you need to use it with Web.Contents function to download the file into memory.

Of course it won't work if the file doesn't exist or the link is not valid anymore. So, if you test this with the URL above, it won't work since the file doesn't exists.
 
Upvote 0
hi man..
i have edit in data source then
i have change my code from power query like this:
original code (can't connect to data source)
Power Query:
 Source = Excel.Workbook(Web.Contents("https://www.dropbox.com/s/tz7zkkgsp0tlt9n/KPKNL%20BUKITTINGGI%202022.xlsx?dl=1"), null, true),

after use your code
Power Query:
 Source = Excel.Workbook(Web.Contents("https://www.dropbox.com/s/tz7zkkgsp0tlt9n/KPKNL%20BUKITTINGGI%202022.xlsx?dl=1")
but still not working
show message "Expression.SyntaxError: Token Comma expected."

the file name is already exist but have renaming before then back renaming again to original file name when success connecting
 
Upvote 0
my guess in dropbox, when you have rename the file, it's make/create new link that make different from the before link.
i means link this 'https://www.dropbox.com/s/tz7zkkgsp0tlt9n...............' may be make this why can't connected again
that's just a guess
 
Upvote 0
I didn't add Excel.Workbook function into my post since you didn't post the entire code.

Now I can see you have ?dl=1 in the original code already.

However, the file doesn't exist on Dropbox. Otherwise, I should be able to download the file instead 401 error when I click on it.


I suggest copying the share link from DropBox, adding the ?dl=1 at the end and use it in the code.
 
Upvote 0
Solution
hi man..
if the file is already , then someday my stuff do rename that file, what effect ? my data connection will lose again?
 
Upvote 0
then someday my stuff do rename that file,
Then it means the Dropbox link will change and the code will fail since the link is changed. You'll need to update the Dropbox link.
In fact, when the file name is changed, then you'll need to change the code anyway since it already contains the file name.

I hope it makes sense.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top