Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do rename the active workbook

Status
Not open for further replies.

braven

Programmer
May 20, 2009
58
CA
could you please help me
how do save it in particular folder already open the active workbook.
 


workbookobject.SaveAs PatheFileName

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
thanks i knew that. i have open active workbook. when i run the macro (macro for excel to screen) it says already open even i tried to close it it says read only.
another issue i have open the workbook save it dfifierent folder and run the macro. make sure this workbook has in this folder name.
if already closd the workbook it save as works fine
but lready open the active workbook save as not working. it says read only error
 
skip
here is the code
wbExcel.SaveAs file_name
the macro : file_name = "c:\test.xls"
Set appexcel = CreateObject("excel.application")
Set wbExcel = appExcel.Workbooks.Open ("file_name")
'appExcel.Visible = True

Set wbExcel = appExcel.Workbooks.Add

wbExcel.SaveAs file_name


 


Your sentence structure makes it extremely difficult to understand what your problem really is. You need to state your issues clearly, concisely & completely.

Where are you running your code from?

Please post your code.

Please post all error messages and the statement that errors.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip
thanks for you. Trying to help for me
i have already open the differnrt name workbook which is save as for example c:\ test.xls
running macro for scraping excel to extra!
here is the code i tried. it works fine when the work book is not opend. the user point of view is this right excel to run for and another one they would like to know whether it is already exist one or new one?
or is it possible any other way to do?
please
wbExcel.SaveAs file_name
the macro : file_name = "c:\test.xls"
Set appexcel = CreateObject("excel.application")
Set wbExcel = appExcel.Workbooks.Open ("file_name")
'appExcel.Visible = True

Set wbExcel = appExcel.Workbooks.Add

wbExcel.SaveAs file_name


 


it works fine when the work book is not opend.
The check the open workbooks before attempting to open.

Use the Workbooks Collection.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip
thanks pointing out. the below one for new workbook
Set wbExcel = appExcel.Workbooks.Add
if it is already open
i try this one it says read only .
wbExcel.SaveAs file_name and it is not picking the excel

 
wbExcel.SaveAs file_name and it is not picking the excel
What exactly does that mean? 'picking'???

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip
i might be wrong. tell me already open the workbook howto use saveas and how the user will know this is the excel is wriitng
 
Skip
thanks a lot i figured it out. learnt lot from here.
instead of this
Set appexcel = CreateObject("excel.application")
this one
Set appExcel = GetObject(, "Excel.Application")
so that alrady opend excel saveas in different folder

but one thing i need to know how to have diffferent folder active workbook
it has syntax error.
Set wbExcel = appExcel.Workbooks.Open ActiveWorkbook


 


You cannot OPEN an ActiiveWorkbook.

You can, however...
Code:
 Set wbExcel = ActiveWorkbook


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top