For that workbook, you'd use "Allocate.xlsm - Excel"
Close.xls file by a macro
-
- Administrator
- Posts: 78537
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Close.xls file by a macro
You should replace "WINDOWTITLE eq Microsoft Excel - Book3.xls" with the title displayed in the title bar of the Excel window of the workbook. Here is an example:
For that workbook, you'd use "Allocate.xlsm - Excel"
For that workbook, you'd use "Allocate.xlsm - Excel"
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- Banned
- Posts: 253
- Joined: 22 Apr 2020, 17:24
Re: Close.xls file by a macro
But it is not working for that file
No Problem Sir
Thnx Alot For the Great Help HansV Sir
No Problem Sir
Thnx Alot For the Great Help HansV Sir
-
- Banned
- Posts: 1
- Joined: 16 Aug 2020, 09:27
Re: Close.xls file by a macro
I got the solution for this Problem
Is there any modification required then plz let me know?
This is my logic & this macro doest the same what i want & this will be the perfect sultion for me as per my needs
Code: Select all
Option Explicit
Sub STEP2()
Dim wkb As Workbook
Set wkb = Workbooks.Add
wkb.SaveAs Filename:="C:\Users\**I've been banned**\Desktop\FALSEFALSEFALSE.xlsx"
wkb.Close
Dim fso As Object
Dim strFileName As String
Dim strFileExists As String
Set fso = CreateObject("scripting.filesystemobject")
strFileName = "C:\Users\**I've been banned**\Desktop\FALSEFALSEFALSE.xlsx"
strFileExists = Dir(strFileName)
If strFileExists > "" Then
fso.movefile Source:="C:\Users\**I've been banned**\Desktop\FALSEFALSEFALSE.xlsx", _
Destination:="C:\Users\**I've been banned**\Desktop\**I've been banned**\9.15\FALSEFALSEFALSE.xlsx"
Shell "taskkill /F /IM EXCEL.EXE"
Else
End If
End Sub
This is my logic & this macro doest the same what i want & this will be the perfect sultion for me as per my needs