i have a problem and i hope you can help me, i have a workbook (pr-pri check 2.3.xls) it's stored in my laptop, and i should download from the server 2 other xls file whitch i will need them in my macro (these two file must be opened) my macro is like this :
Code:
Sub lock()
Dim ff As Integer
Dim strFile As String
Dim strBuffer As String
Dim pr As Workbook, pri As Workbook, pr_pri As Workbook
Dim wspr As Worksheet, wspri As Worksheet, wspr_pri As Worksheet
Set pr = Workbooks("PR_DETAIL(GD330_ANLDSV).xls")
Set pri = Workbooks("GD330AT-00-V10o-204-XX-JAN-12-2010+0_PRI.xls")
Set pr_pri = Workbooks("PR-PRI Check 2.3.xls")
Set wspr = pr.Worksheets("PR_DETAIL(GD330_ANLDSV)")
Set wspri = pri.Worksheets("PRI DATA")
Set wspr_pri = pr_pri.Worksheets("Feuil1")
Workbooks("PR_DETAIL(GD330_ANLDSV).xls").Activate
Workbooks("GD330AT-00-V10o-204-XX-JAN-12-2010+0_PRI.xls").Activate
Workbooks("PR-PRI Check 2.3.xls").Activate
strFile = "C:\Program Files\teraterm\code.txt"
ff = FreeFile
strBuffer = wspri.Range("F29").Value
Open strFile For Binary Access Write As #ff
Put #ff, , strBuffer
Close #ff
strFile = "C:\Program Files\teraterm\type.txt"
ff = FreeFile
strBuffer = wspri.Range("F33").Value
Open strFile For Binary Access Write As #ff
Put #ff, , strBuffer
Close #ff
End Sub
my problem is in line 8 and 9 when i must write the name of the two xls file in my macro but the name of the two file change in the server, it is not the same fo example his name is "PR_DETAIL(GD330_ANLDSV).xls" but another time his name will change :s
how can i have a genaral case not specific for the tow file??????
hope i m clear i you can help me
i posted this thread here also: http://www.mrexcel.com/forum/showthr...79#post2246679
Bookmarks