Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default external file counter

I have a macro in which the user will generate a packing slip. Thi
macro is available on three machines which all have access to a networ
drive. (L:). I want to have a txt file on this drive with a intege
value and whenever the packing slip macro is run, it will take thi
value from this file, increment it by one, and then save it. I don'
know if this is possible because of sharing violations or having tw
macros running at the same time. I have looked around and havent bee
able to find any code for an external file counter. Any example code o
even a link to information concerning this would be great
thank

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening An External File Matthew[_2_] Excel Discussion (Misc queries) 3 October 5th 09 03:33 PM
Adding Counter to column for number of identical file numbers Sam Excel Discussion (Misc queries) 1 September 16th 08 06:48 PM
multiple file uploading - runtime error'13': type mismatch "While Counter <= UBound(FName)" Sinner Excel Discussion (Misc queries) 3 March 1st 07 09:44 AM
How do I reference external data from a file, file name found in . Clux Excel Discussion (Misc queries) 1 February 10th 05 10:52 PM
Get External Data, Import Text File, File name problem Scott Riddle Excel Programming 1 July 11th 03 05:40 PM


All times are GMT +1. The time now is 07:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"