ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to open each file from the folder and save again (https://www.excelbanter.com/excel-programming/386070-how-open-each-file-folder-save-again.html)

ruic

How to open each file from the folder and save again
 
'Set a pointer to the workbook you want to open
Set Wb = Workbooks.Open(Module1.CurrentDrive & "\Share\" & Module1.CurrentYear & "\" & AccountsLB.List(I), False, False)

'Make some changes to the work book'
Wb.Worksheets("January").Range("A1").Value = TitleOfBook

'Save your changes and close the workbook
Wb.Save
Wb.Close False

'Clean up the pointer otherwise memory doesn't get relased
Set Wb = Nothing

--
Rui

"L.K." wrote in message ...
Dear All,

I have problem to write macro. it should be simple.
I want to open each excel file from the specific folder, do some operations (it is Edit-Links and break links) and save file again with the same name.

I recorded macro how to do operations after opening file but I couldn't how to cycle opening of files and save them.

Thank you for help.
Lado

Ron de Bruin

How to open each file from the folder and save again
 
See
http://www.rondebruin.nl/copy4.htm

You can change the Copy code to your code

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"L.K." wrote in message ...
Dear All,

I have problem to write macro. it should be simple.
I want to open each excel file from the specific folder, do some operations (it is Edit-Links and break links) and save file again with the same name.

I recorded macro how to do operations after opening file but I couldn't how to cycle opening of files and save them.

Thank you for help.
Lado

L.K.

How to open each file from the folder and save again
 
Dear All,

I have problem to write macro. it should be simple.
I want to open each excel file from the specific folder, do some operations (it is Edit-Links and break links) and save file again with the same name.

I recorded macro how to do operations after opening file but I couldn't how to cycle opening of files and save them.

Thank you for help.
Lado

L.K.

How to open each file from the folder and save again
 
Thank you!
It's really helpful.

Kindly,
Lado

"Ron de Bruin" wrote in message ...
See
http://www.rondebruin.nl/copy4.htm

You can change the Copy code to your code

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"L.K." wrote in message ...
Dear All,

I have problem to write macro. it should be simple.
I want to open each excel file from the specific folder, do some operations (it is Edit-Links and break links) and save file again with the same name.

I recorded macro how to do operations after opening file but I couldn't how to cycle opening of files and save them.

Thank you for help.
Lado


All times are GMT +1. The time now is 05:33 PM.

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