ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error in VBA code to save workbook (https://www.excelbanter.com/excel-programming/296720-re-error-vba-code-save-workbook.html)

pikus

Error in VBA code to save workbook
 
Try this:

Sub Macro1()
Workbooks.Open Filename:= _
"G:\XXX\Example.xls"
Application.Run ("Example.xls!SecondMacro")
Workbooks(“Example.xls”).Save
ActiveWindow.Close
End Sub

- Piku

--
Message posted from http://www.ExcelForum.com


djchriste

Error in VBA code to save workbook
 
Sorry

That still generates the same error message whent the line "Workbooks(€œExample.xls€).Save" is executed......


----- pikus wrote: ----

Try this

Sub Macro1(
Workbooks.Open Filename:=
"G:\XXX\Example.xls
Application.Run ("Example.xls!SecondMacro"
Workbooks(€œExample.xls€).Sav
ActiveWindow.Clos
End Su

- Piku


--
Message posted from http://www.ExcelForum.com




All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com