Hi There
I am beginner of VBA and my predecessor left me a set of modules (for me it is very complicated). The modules were written under WindowXP excel 2007. Now the modules need to be run under window xp and window7 parallelly. Obviously, due to the path structure differences between 2 windows. I have tried to change as much as I can, at the end I screw up a lots. I need your expertise to help. I have highlighted in Bold where have problem. Actually i think the way i did is not right. Very appreciate if you can go through the whole module to help

Here is the code
Sub ticketcreation()
 
   Dim ws As Worksheet
    Dim wb As Workbook
    Dim hardstop As Range
Dim gdshs As Range
Dim luptonshs As Range
Set gdshs = ThisWorkbook.Names("gdshs").RefersToRange
Set luptonshs = ThisWorkbook.Names("luptonshs").RefersToRange

    Dim FName As String, FPath As String, SYMBOL As String
SYMBOL = Range("G9").Value
If Dir("C:\Users\TEST1\Documents\My Documents\My Excel\TEST2\Order Tickets\") = "" Then
FPath = "C:\Documents and Settings\VICKIE\My Documents\My Excel\ACL\"
ChDrive "C:\Documents and Settings\VICKIE\my Documents\My Excel\ACL"
Else
FPath = "C:\Users\TEST1\Documents\My Documents\My Excel\TEST2\Order Tickets\"
ChDir "C:\Users\TEST1\Documents\My Documents\My Excel\TEST2\Order Tickets"
End If
FName = "ACL Equity Sales_" & Format(Date, "MMMDD_")
clients = Range("B16:B24").Value
DBclients = Range("B28").Value
BoSclients = Range("B31").Value
BrokerAclients = Range("B34").Value
BrokerBclients = Range("B37").Value

numshares = Range("D16:D24").Value
dbnumshares = Range("D28").Value
bosnumshares = Range("D31").Value
brokerAnumshares = Range("D34").Value
BrokerBnumshares = Range("D37").Value
csnum = Range("A16:A24").Value
DBnum = Range("A28").Value
bosnum = Range("A31").Value
brokerAnum = Range("A34").Value
brokerBnum = Range("A37").Value
round_lot = Range("E12").Value
stock = Range("E7:E9").Value
    Workbooks.Open FileName:= _
 FPath & "ACL EOT Sales CS template.xlsx"
             
    
    Application.Run "BLPLinkReset"
Set wb = ActiveWorkbook
Range("a29:a37") = csnum
Range("b29:b37") = clients
Range("c29:c37") = numshares
Range("b19") = Date
Range("b20") = Time
Range("B22") = SYMBOL
Range("b23:b25") = stock
Range("b26") = round_lot
Range("A1").Select
wb.SaveAs FPath & FName & SYMBOL & "-CS"

wb.Close
'//////CREATE DB TICKET//////////
If gdshs > 0 Then
With create_DB_ticket
    Workbooks.Open FileName:= _
        FPath & "ACL EOT Sales DB template.xlsx"        
    Application.Run "BLPLinkReset"
Set wb = ActiveWorkbook
Range("b19") = Date
Range("b20") = Time
Range("B22") = SYMBOL
Range("b23:b25") = stock
Range("b26") = round_lot
Range("A29") = DBnum
Range("B29") = DBclients
Range("C29") = dbnumshares
Range("A1").Select
wb.SaveAs FPath & FName & SYMBOL & "-DB"
wb.Close
End With
Else: End If
'//////CREATE BOS//////////

If luptonshs > 0 Then
With create_BoS_ticket
    Workbooks.Open FileName:= _
        FPath & "ACL EOT Sales BoS template.xlsx"    
Application.Run "BLPLinkReset"
Set wb = ActiveWorkbook
Range("B19") = Date
Range("B20") = Time
Range("B22") = SYMBOL
Range("B23:B25") = stock
Range("B26") = round_lot
Range("A29") = bosnum
Range("B29") = BoSclients
Range("C29") = bosnumshares
Range("A1").Select
wb.SaveAs FPath & FName & SYMBOL & "-BoS"
wb.Close
End With
Else: End If

'//////CREATE BrokerA TICKET//////////

If ClientAshs > 0 Then
With create_BrokerA_ticket
    Workbooks.Open FileName:= _
        FPath & "ACL EOT Sales BrokerA template.xlsx"
    Application.Run "BLPLinkReset"
Set wb = ActiveWorkbook
Range("B19") = Date
Range("B20") = Time
Range("B22") = SYMBOL
Range("B23:B25") = stock
Range("B26") = round_lot
Range("A29") = brokerAnum
Range("B29") = BrokerAclients
Range("C29") = brokerAnumshares
Range("A1").Select
wb.SaveAs FPath & FName & SYMBOL & "-BrokerA"
wb.Close
End With
Else: End If

'//////CREATE BrokerB TICKET//////////

If ClientBshs > 0 Then
With create_BrokerB_ticket
    Workbooks.Open FileName:= _
        FPath & "ACL EOT Sales BrokerB template.xlsx"    
Application.Run "BLPLinkReset"
Set wb = ActiveWorkbook
Range("B19") = Date
Range("B20") = Time
Range("B22") = SYMBOL
Range("B23:B25") = stock
Range("B26") = round_lot
Range("A29") = brokerBnum
Range("B29") = BrokerBclients
Range("C29") = BrokerBnumshares
Range("A1").Select
wb.SaveAs FPath & FName & SYMBOL & "-BrokerB"
wb.Close
End With
Else: End If
 
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
MsgBox ("Sales order tickets created and settlement proceeds added to cash")
MsgBox ("NO SALES for PG accounts")
End Sub
MANY MANY THANKS.....without this site i dont know how can i survive...


Vickie