path can't find if the path is in network

mark692

Active Member
Joined
Feb 27, 2015
Messages
321
Office Version
  1. 2016
Platform
  1. Windows
hi sir i have a code here but when i use the path on network the code can't find it but if i use a path not on network it works fine

Sub Submit() Application.ScreenUpdating = False
Dim wbk As Workbook
Dim Fname As String
Dim pth As String
Dim Addr As String


pth = "\\LIZASOTSSERVER\LizasoTSNetworkFiles\RUBY LULAY Daily Report"
Fname = "Sales Check Online.xlsx"
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=8, Criteria1:= _
">0"
Range("Table1[[Invoice Date]:[Time Date]]").Select
Selection.Copy

Addr = Selection.Address
If Not wbkExists(Fname) Then
Set wbk = Workbooks.Open(pth & Fname)
Else
Set wbk = Workbooks(Fname)
End If

ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Select
Do While ActiveCell = Empty
ActiveCell.Offset(-1, 0).Select
Loop
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

''wbk.Sheets("Sales").Range("D5").PasteSpecial
ThisWorkbook.Activate
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=8

ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=8, Criteria1:= _
">0"
Range("Table2[[Check or Acknowledgement]:[Time Date]]").Select
Selection.Copy

''Range("Table5[QTY]").Copy
Workbooks("Sales Check Online.xlsx").Activate
Worksheets("Payment Receive").Activate

ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Select
Do While ActiveCell = Empty
ActiveCell.Offset(-1, 0).Select
Loop
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ThisWorkbook.Activate
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=8

wbk.Application.DisplayAlerts = False
wbk.Save
wbk.Close

''Sheets("Input").Activate
''Sheets("Input").Calculate


End Sub


the Bold code is the network path,
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
is it supposed to look like two spaces \ \ rather than \\ can you get that as a path and copy from what works straight into the vba
 
Upvote 0
is it supposed to look like two spaces \ \ rather than \\ can you get that as a path and copy from what works straight into the vba

i coppied it straight from the address bar sir this is the error sir

qJAtm
qJAtm
 
Upvote 0
so is it fixed by taking the extra spaces out ?
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
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