Help with VBA code that stopped working

Kmac224

New Member
Joined
Jun 15, 2015
Messages
47
Office Version
  1. 2010
Platform
  1. Windows
Hello,

I have the following code that was working to open a file from a certain directory and it stopped working. Does anyone see anything wrong with the code? Thanks in advance!

Code:
Sub CIRS()
 
Dim DATstr As String
 
DATstr = Format((IIf(Weekday(Date) = 2, Date - 3, Date - 1)), "yyyymmdd")
 
Workbooks.Open "[URL="file://\\imports\preproc\archive\ABC\XYZ\Pricing_DEF_GHIJ\outbound\"]\\imports\preproc\archive\ABC\XYZ\Pricing_DEF_GHIJ\outbound\[/URL]" & DATstr & "\*ABC_DEF.csv"
 
    
End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
The file that you're trying to .Open - does it definitely exist?

If you do a Dir(filename) before you try to open it, what does that return?
 
Upvote 0

Forum statistics

Threads
1,214,829
Messages
6,121,827
Members
449,051
Latest member
excelquestion515

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