Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hello,
Is it possible to close a .csv file while you are in .xlsm. Here is my situation, I have a .xlm file and a .csv file open at the save time and I would like to run a macro that closes the .csv file. My problem is I can not give it specific file name to close because .csv is auto saves it self every day with different name, so I have to close all *.csv files. any help. thx. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200709/1 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could use a macro that closes all the .csv files:
Option Explicit Sub testme01() Dim wkbk As Workbook For Each wkbk In Application.Workbooks If LCase(Right(wkbk.Name, 4)) = LCase(".csv") Then wkbk.Close savechanges:=False End If Next wkbk End Sub "saman110 via OfficeKB.com" wrote: hello, Is it possible to close a .csv file while you are in .xlsm. Here is my situation, I have a .xlm file and a .csv file open at the save time and I would like to run a macro that closes the .csv file. My problem is I can not give it specific file name to close because .csv is auto saves it self every day with different name, so I have to close all *.csv files. any help. thx. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200709/1 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you bro. worked fine.
Dave Peterson wrote: You could use a macro that closes all the .csv files: Option Explicit Sub testme01() Dim wkbk As Workbook For Each wkbk In Application.Workbooks If LCase(Right(wkbk.Name, 4)) = LCase(".csv") Then wkbk.Close savechanges:=False End If Next wkbk End Sub hello, [quoted text clipped - 10 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200709/1 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200709/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why excel close all files when I just want to close one files | Excel Discussion (Misc queries) | |||
Auto close userform | Excel Discussion (Misc queries) | |||
auto close userform | Excel Discussion (Misc queries) | |||
fix for open/close files problem | New Users to Excel | |||
Auto-save worksheet on close? | Excel Discussion (Misc queries) |