![]() |
#3
|
|||
|
|||
![]()
Probably need to see all of your code in that macro rather than just one line.
However ... two probable causes: #1 - The file is no longer where you remember it being and Excel can't find it. #2 - Part of your code is missing. Regarding #2 ... example code: Code:
Sub ImportWorksheet() ' This macro will import a file into this workbook Sheets("Sheet1").Select PathName = Range("D3").Value '<--- could easily be the actual path instead of the path written to a cell Filename = Range("D4").Value '<-- could be the actual filename instead TabName = Range("D5").Value ControlFile = ActiveWorkbook.Name Workbooks.Open Filename:=PathName & Filename ActiveSheet.Name = TabName Sheets(TabName).Copy After:=Workbooks(ControlFile).Sheets(1) Windows(Filename).Activate ActiveWorkbook.Close SaveChanges:=False Windows(ControlFile).Activate End Sub what is meant by Filename:=PathName & Filename Does you code provide the reference for fileloc ? |
Tags |
filename |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word does not show filename during edit | es35 | Word | 5 | 10-29-2016 12:12 AM |
use full path for filename | ruggb | Word | 1 | 08-21-2015 05:10 AM |
![]() |
HighSierra | Word | 6 | 05-06-2015 07:04 PM |
![]() |
NobodysPerfect | Word VBA | 2 | 08-14-2014 10:09 PM |
MarkAsFinal - 'Edit Anyway' edit popup issue | GovindRS | PowerPoint | 1 | 06-20-2011 06:43 AM |