Run-Time Error '1004' - Microsoft Excell Cannot Access the file

arefaay

New Member
Joined
Mar 25, 2014
Messages
1
Hello :)

this is my first macro ever, and i hope you cna help me to start a good relation with this wonderful tool.

It used to work very well and then - it simply doesn't work even if i rewrite it in another file. i Get this message after trying to open the file - Run-Time Error '1004' - Microsoft Excell Cannot Access the file

i checked the file and downloaded it manualy and it is working fine

the macro stops when it begins to open the file

Sub Heliumcheck()
'
' Heliumcheck Macro
'
Dim wbMe As Workbook
Dim wsNew As Worksheet
Dim w As Integer
Dim wbURL As Workbook
Dim url As String
Set wbMe = ThisWorkbook
url = "http://specificfileinmycompany.xls"
Set wbURL = Workbooks.Open(url)
'## Add code to copy this data to your workbook and/or manipulate the data...'
w = wbMe.Sheets.Count
'## Copy & Paste this data in to our new worksheet:'
'wbURL.Sheets(2).Cells.Copy Destination:=wsNew.Range("A1")'
wbURL.Sheets(2).Cells.Range("A:F").Copy Destination:=wbMe.Sheets(1).Cells.Range("A:F")
'## Close the downloaded version which we no longer need:'
wbURL.Close
End Sub

appreciate your help very much
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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