Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-27-2017, 03:28 PM
Logit Logit is offline Edit Filename Path? Windows 10 Edit Filename Path? Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

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
Note there is a reference made to Filename and Pathname so Excel knows
what is meant by Filename:=PathName & Filename

Does you code provide the reference for fileloc ?
Reply With Quote
 

Tags
filename

Thread Tools
Display Modes


Similar Threads
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
Edit Filename Path? How to: Have two templates cross-reference each other independent of filename path HighSierra Word 6 05-06-2015 07:04 PM
Edit Filename Path? Change old path to new path (batch) 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft