Different path

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
 
C

crferguson

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
 
M

Marc Gendron

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top