Different path

  • Thread starter Thread starter Marc Gendron
  • Start date Start date
M

Marc Gendron

Hi guys,

A snip of code to open a workbook or create one if it does not exist.

On Error GoTo CreateNewWorkbook
Application.ScreenUpdating = False
Workbooks.Open directory & filetext

Why does Excel keep poppin'up saying ".....cannot be found. Check your
spelling, or try a different path.


It does open my workbook if it exists, or it does go to "Create Workbook"
and creates my workbook if not. Works fine. The only bug is the pop-screen.

Well, you guys are the different path I'm trying.

Thanks in advance
Marc
 
Hi guys,

A snip of code to open a workbook or create one if it does not exist.

On Error GoTo CreateNewWorkbook
    Application.ScreenUpdating = False
    Workbooks.Open directory & filetext

Why does Excel keep poppin'up saying ".....cannot be found. Check your
spelling, or try a different path.

It does open my workbook if it exists, or it does go to "Create Workbook"
and creates my workbook if not. Works fine.  The only bug is the pop-screen.

Well, you guys are the different path I'm trying.

Thanks in advance
Marc

Instead of wrapping the text with Application.ScreenUpdating=False,
use Application.DisplayAlerts=False. Be sure to use
Application.DisplayAlerts=True at the end of the code though! I'd put
it right after the Workbooks.Open line as well as in the
CreateNewWorkbook code in case it finishes out there.

Thanks,
Cory
 
Thanks Cory

Works perfect !

Marc

Instead of wrapping the text with Application.ScreenUpdating=False,
use Application.DisplayAlerts=False. Be sure to use
Application.DisplayAlerts=True at the end of the code though! I'd put
it right after the Workbooks.Open line as well as in the
CreateNewWorkbook code in case it finishes out there.

Thanks,
Cory
 
Back
Top