How to open each file from the folder and save again

  • Thread starter Thread starter ruic
  • Start date Start date
R

ruic

'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

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
 
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


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
 
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
 
Thank you!
It's really helpful.

Kindly,
Lado

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


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
 
Thank you!
It's really helpful.

Kindly,
Lado

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


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top