Fean
06-07-2016, 08:23 AM
Hi,
I have an debug which i dont understand. A error Run-time Error '1004' - Method 'Open' of object 'Workbooks' failed
On my pc its runs smoothly.. another person gets this run time error?
Set WbData = Application.Workbooks.Open(Filename:=(FName))
I have always used this code for opening excel files and suddenly it stops working on another pc's? Kind of very crucial to open a file..
Any ideas?
Dim WbMacro As WorkbookDim WbData As Workbook
Dim FName As String
Dim bValidBook As Boolean
Dim supL As String
Dim EntNr As String
Dim StrFilename As String
Dim Datum As String
Dim Pass As String
Set WbMacro = ThisWorkbook
Dim SubTotal As String
Application.ScreenUpdating = False
Do Until Sheets("Do not delete").Cells(1, 4) = "x" 'Or bErrFound
FName = Sheets("Macro").Cells(7, 3) 'MasterFile
bValidBook = True
Set WbData = Application.Workbooks.Open(Filename:=(FName)) 'open file '<------ HERE I GET A DEBUG
WbMacro.Sheets("Do not delete").Cells(1, 4).Copy 'Entity
etc..
I have an debug which i dont understand. A error Run-time Error '1004' - Method 'Open' of object 'Workbooks' failed
On my pc its runs smoothly.. another person gets this run time error?
Set WbData = Application.Workbooks.Open(Filename:=(FName))
I have always used this code for opening excel files and suddenly it stops working on another pc's? Kind of very crucial to open a file..
Any ideas?
Dim WbMacro As WorkbookDim WbData As Workbook
Dim FName As String
Dim bValidBook As Boolean
Dim supL As String
Dim EntNr As String
Dim StrFilename As String
Dim Datum As String
Dim Pass As String
Set WbMacro = ThisWorkbook
Dim SubTotal As String
Application.ScreenUpdating = False
Do Until Sheets("Do not delete").Cells(1, 4) = "x" 'Or bErrFound
FName = Sheets("Macro").Cells(7, 3) 'MasterFile
bValidBook = True
Set WbData = Application.Workbooks.Open(Filename:=(FName)) 'open file '<------ HERE I GET A DEBUG
WbMacro.Sheets("Do not delete").Cells(1, 4).Copy 'Entity
etc..