Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Sir,
I've created macro in Excel file named "macro.xls". This macro is open Excel file name "pc.xls" from my P.C path "C:\excel\". Once I run the macro, the Excel file "pc.xls" workbook is open but I want to close the Excel file("macro.xls") and the Excel file "pc.xls" is remain open for editing. The coding as below: Private Sub Workbook_Open() filepathw = "c:\excel\" fileorg = filepathw & "pc.xls" Workbooks.Open (fileorg) End Sub --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Add
thisworkbook.close savechanges:=false right before the "End Sub" It'll close the workbook that containst the procedure. (And it'll close it without saving. Make sure you save it before you run it.) skchow wrote: Dear Sir, I've created macro in Excel file named "macro.xls". This macro is open Excel file name "pc.xls" from my P.C path "C:\excel\". Once I run the macro, the Excel file "pc.xls" workbook is open but I want to close the Excel file("macro.xls") and the Excel file "pc.xls" is remain open for editing. The coding as below: Private Sub Workbook_Open() filepathw = "c:\excel\" fileorg = filepathw & "pc.xls" Workbooks.Open (fileorg) End Sub --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel file opens MS Excel Training Webpage When the Excel file ope | Excel Discussion (Misc queries) | |||
How to copy 2007 excel file formula results into a 2003 Excel file | Excel Discussion (Misc queries) | |||
double click excel file on the desktop excel opens but not file? | Excel Discussion (Misc queries) | |||
Excel 2003: doubleclick on file opens Excel window, not file. | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) |