VBA Error Run-Time Error 9 Subscript out of Range

P

PoppaO

I have two lines of code that continues to fail on some workstations and not
others. On the Dell laptop D610 the macro works great and the Dell D620
fails
at two specific lines of code. The lines are marked with an * My goal is
to copy a sheet to a workbook. Please Advise? Thanks,

Sub Getstructure(filepathname2, filename1, filename2, file_path2)
ChDrive file_path2
ChDir file_path2
Workbooks.Open Filename:=filepathname2
Sheets("Application Structure").Activate
* Sheets("Application Structure").Copy
After:=Workbooks(filename1).Sheets(3)*
Application.DisplayAlerts = False
* Workbooks(filename2).Close SaveChanges:=False*
Application.DisplayAlerts = True
 

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