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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

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