Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.access
|
|||
|
|||
Rename Excel file via VBA
Hi All,
I have the following VBA code that opens an Excel file from my Access database. Does anyone know how I would write the code to rename the file? For example, rename "_ABC_123" to "ABC_123" Thanks in advance! Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Dim db As DAO.Database Dim myRec As DAO.Recordset Set xlApp = CreateObject("Excel.Application") Set xlApp = CreateObject("Excel.Application") Set xlWrkBk = xlApp.Workbooks.Open(strInputFileName) Set db = CurrentDb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
rename excel file name | Excel Discussion (Misc queries) | |||
rename shared Excel file | Excel Discussion (Misc queries) | |||
Can you copy a Excel file to a new directory and rename it? | Excel Discussion (Misc queries) | |||
Macros in Excel - Save as and rename file | Excel Programming | |||
Macros in Excel - Save as and rename file | Excel Programming |