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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Ruddles

Well-known Member
Joined
Aug 24, 2010
Messages
5,815
Office Version
  1. 365
Platform
  1. Windows
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,191,119
Messages
5,984,758
Members
439,909
Latest member
daigoku

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
Top