Dear Team,
I am new to VBA and trying to develop a code to do following
(i) to do required computation.
(ii) Saves the workbook and close the workbook
(iii) Open the workbook again
Re-opening is being done to refresh the pivot table.
Code used to close the workbook has been taken from excelforum itself
ThisWorkbook.Save
If Workbooks.Count = 1 Then Application.Quit
If Workbooks.Count >= 2 Then
ThisWorkbook.Close SaveChanges:=True
Application.Quit
End If
The VBA is working till closing the workbook, but is not taking command to re-open as the application is already quite and further steps cannot be executed.
The code tried to open the workbook are used as below -
(i) 'Workbooks.Open Filename:="ActiveWorkbook.FullName
(ii) 'Workbooks.Open Filename:="E:\Kamal personal Folder\Excel \VBA Tutorial-learning vba.xlsm"
(iii) 'Dim MyFile As String
'MyFile = Application.GetOpenFilename()
All three are not working
I want to keep path dynamic so that , wherever it goes, it may identify the path and open itself.
Is it possible by any way.
Bookmarks