+ Reply to Thread
Results 1 to 3 of 3

plzz i need help

  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    Tunis
    MS-Off Ver
    Excel 2003
    Posts
    5

    plzz i need help

    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

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: plzz i need help

    Please take a few minutes to reread the forum rules, amend your thread title accordingly, and edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: plzz i need help

    hatemhatem

    Despite being told to read the Forum rules in your last post you still haven't bothered.

    Read the Rules & follow them or don't bother posting
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1