How to retrieve data from share folder using vba?

G

geniusideas

Hi,
I wanted to create macro that able to retrieve data from share folder
through path \43.74.94.102\folder name\filename.xls (Example) then
copy to my current workbook. Pls help..

Thanks
 
T

Tim Williams

dim wb as excel.workbook

set wb=workbooks.open("\\43.74.94.102\folder name\filename.xls")

with wb.sheets("sheettocopyfrom")
.range("A1:G500").copy thisworkbook.sheets("tohere").range("A1")
end with

wb.close false

Totally untested, but you get the idea.

Tim
 
G

geniusideas

dim wb as excel.workbook

set wb=workbooks.open("\\43.74.94.102\folder name\filename.xls")

with wb.sheets("sheettocopyfrom")
     .range("A1:G500").copy thisworkbook.sheets("tohere").range("A1")
end with

wb.close false

Totally untested, but you get the idea.

Tim

TQ..
Got the idea and will test asap..
 

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

Top