View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
l1075[_8_] l1075[_8_] is offline
external usenet poster
 
Posts: 1
Default external file counter

Sub GetDataFromClosedWorkbook()
Dim wb As Workbook
Application.ScreenUpdating = False ' turn off the screen updating
Set wb = Workbooks.Open("L:\Foldername\Filename.xls", True, True)
' open the source workbook, read only
Dim Counter As Integer

With ThisWorkbook.Worksheets("TargetSheetName")
' read data from the source workbook
Counter = wb.Worksheets("Worksheet1").Range("A10").Formula
Counter = Counter + 1

End With
wb.Close False '

Set wb = Nothing ' free memory
Application.ScreenUpdating = True ' turn on the screen updating

End Sub

This current code does not save the changes, I want to be able to sav
the sourceworkbook

thank

--
Message posted from http://www.ExcelForum.com