Results 1 to 7 of 7

Module works on window XP but not window 7 (using same Excel 2007)

Threaded View

  1. #1
    Registered User
    Join Date
    01-31-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2007
    Posts
    5

    Module works on window XP but not window 7 (using same Excel 2007)

    Hi

    I have ran the following module via Excel 2007 on window XP platform, i have no issue on it. But when i run on Window 7 by using Excel 2007, a debug message pop out in BOLD as follow. I have changed the dir path, it does not work.

    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\TURNET\Documents\My Documents\My Excel\TEMP\Order\") = "" Then
    FPath = "C:\Documents and Settings\Vickie\My Documents\My Excel\ACL\"
    ChDir "C:\Documents and Settings\Vickie\My Documents\My Excel\ACL"
    Else
    FPath = "C:\Users\TURNET\Documents\My Documents\My Excel\TEMP\Order\"
    ChDir "C:\Users\TURNET\Documents\My Documents\My Excel\TEMP\Order"
    End If
    
    FName = "Daily 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 & "Daily 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"



    Please help. Highly appreciated. Many thanks
    Vickie
    Last edited by wongwlv; 02-16-2012 at 04:06 AM.

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