Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am having a problem with this line in my code:
Set f = fs.GetFileName(RFDSFile) A Type mismatch error message. Any ideas? =RFDSFile is a filepath Sub RFDS_File(RFDSFile As String) Dim fs, f Workbooks.Open RFDSFile, ReadOnly:=True Sheets("RFDS").Select Worksheets("RFDS").Copy After:=Workbooks("RFDS Tracker GA Market_Form 4C.xls").Sheets("RFDS Tracker (2)") Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFileName(RFDSFile) Workbooks(f).Close SaveChanges:=False 'Extract_RFDSData '''''''''''' DELETE RFDS SHEET ''''''''''''''''''''''''''''''''''''''''''''''' Dim sh As Worksheet Application.DisplayAlerts = False For Each sh In Worksheets If Left(sh.Name, 4) = "RFDS" Then sh.Select ActiveWindow.SelectedSheets.Delete End If Next sh Worksheets("RFDS Tracker").Range("A4").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Code expantion , with code! | Excel Discussion (Misc queries) | |||
Unprotect Code Module in Code | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) |