+ Reply to Thread
Results 1 to 11 of 11

How to port macros from Excel 2000 to Excel 2003

  1. #1
    Charlie
    Guest

    How to port macros from Excel 2000 to Excel 2003

    I wrote a macro in VB for applications in Excel 2000 that reads a digital
    multimeter and generates a strip chart. It works well in Excel 2000, but
    gives me some problems in Excel 2003. Essentially, when reading one meter,
    the macro reads garbage (it looks like hex being interpreted as ascii).
    Other software (provided by the multimeter manufacturer) communicates well
    with the Windows XP system. The macro works well with a different
    multimeter. It appears to be a problem with how Excel 2003 interprets the
    incoming data string. How can I go about correcting this?

  2. #2
    NickHK
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    It would depend on what you code is currently doing.

    NickHK

    "Charlie" <[email protected]> wrote in message
    news:[email protected]...
    > I wrote a macro in VB for applications in Excel 2000 that reads a digital
    > multimeter and generates a strip chart. It works well in Excel 2000, but
    > gives me some problems in Excel 2003. Essentially, when reading one

    meter,
    > the macro reads garbage (it looks like hex being interpreted as ascii).
    > Other software (provided by the multimeter manufacturer) communicates well
    > with the Windows XP system. The macro works well with a different
    > multimeter. It appears to be a problem with how Excel 2003 interprets the
    > incoming data string. How can I go about correcting this?




  3. #3
    Charlie
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    NickHK-
    Code reads a string from the com port, writes it to a cell. The string is
    then parsed and values extracted. One version of the code works well with
    one meter on Windows XP, both versions work well on Windows 98. Actually,
    the only difference between the two versions is that the port settings are
    different for the two meters. The meter that gives me garbage talks to the
    manufacturer's software on the Windows XP machine, so I am pretty sure the
    problem is not port settings. Excel 2003 seems to implement the translation
    of the string differently than Excel 2000.

    Charlie

    "NickHK" wrote:

    > It would depend on what you code is currently doing.
    >
    > NickHK
    >
    > "Charlie" <[email protected]> wrote in message
    > news:[email protected]...
    > > I wrote a macro in VB for applications in Excel 2000 that reads a digital
    > > multimeter and generates a strip chart. It works well in Excel 2000, but
    > > gives me some problems in Excel 2003. Essentially, when reading one

    > meter,
    > > the macro reads garbage (it looks like hex being interpreted as ascii).
    > > Other software (provided by the multimeter manufacturer) communicates well
    > > with the Windows XP system. The macro works well with a different
    > > multimeter. It appears to be a problem with how Excel 2003 interprets the
    > > incoming data string. How can I go about correcting this?

    >
    >
    >


  4. #4
    NickHK
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    But without your code it still unknown where a problem may lie.

    NickHK

    "Charlie" <[email protected]> wrote in message
    news:[email protected]...
    > NickHK-
    > Code reads a string from the com port, writes it to a cell. The string is
    > then parsed and values extracted. One version of the code works well with
    > one meter on Windows XP, both versions work well on Windows 98. Actually,
    > the only difference between the two versions is that the port settings are
    > different for the two meters. The meter that gives me garbage talks to

    the
    > manufacturer's software on the Windows XP machine, so I am pretty sure the
    > problem is not port settings. Excel 2003 seems to implement the

    translation
    > of the string differently than Excel 2000.
    >
    > Charlie
    >
    > "NickHK" wrote:
    >
    > > It would depend on what you code is currently doing.
    > >
    > > NickHK
    > >
    > > "Charlie" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    digital
    > > > multimeter and generates a strip chart. It works well in Excel 2000,

    but
    > > > gives me some problems in Excel 2003. Essentially, when reading one

    > > meter,
    > > > the macro reads garbage (it looks like hex being interpreted as

    ascii).
    > > > Other software (provided by the multimeter manufacturer) communicates

    well
    > > > with the Windows XP system. The macro works well with a different
    > > > multimeter. It appears to be a problem with how Excel 2003 interprets

    the
    > > > incoming data string. How can I go about correcting this?

    > >
    > >
    > >




  5. #5
    Charlie
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    Here's the code:

    XMCommCRC1.CommPort = 1
    XMCommCRC1.Settings = "9600,n,8,1"
    XMCommCRC1.PortOpen = True

    'Get meter ID

    XMCommCRC1.Output = "ID" & vbCr

    'Wait for 1 second to allow meter to respond

    NewHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 1
    waitTime = TimeSerial(NewHour, newMinute, newSecond)
    Application.Wait waitTime

    ' get results and format them

    Buffer = XMCommCRC1.InputData
    ActiveSheet.Cells(1, 1).Value = Buffer
    ActiveSheet.Columns("A").Parse _
    parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    Destination:=ActiveSheet.Range("B1")

    XMCommCRC1.PortOpen = False

    And the output in Excel 2000:

    "0
    FLUKE 89, V1.01,75200615
    " "0
    " FLUKE 89 , V1.01, 75200615

    And the output in Excel 2003:

    "ÿ
    FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    " "ÿ
    " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ

    When I use the same code with a second meter, modifying the appropriate port
    settings to suit the other meter, I get good results from both Excel 2000 and
    Excel 2003. When I use the same seriasl interface with the Fluke meter,
    utilizing Fluke software, I get good communications. The problem appears to
    be with the way Excel 2003 interprets the information from the Fluke meter.

    Charlie

    "NickHK" wrote:

    > But without your code it still unknown where a problem may lie.
    >
    > NickHK
    >
    > "Charlie" <[email protected]> wrote in message
    > news:[email protected]...
    > > NickHK-
    > > Code reads a string from the com port, writes it to a cell. The string is
    > > then parsed and values extracted. One version of the code works well with
    > > one meter on Windows XP, both versions work well on Windows 98. Actually,
    > > the only difference between the two versions is that the port settings are
    > > different for the two meters. The meter that gives me garbage talks to

    > the
    > > manufacturer's software on the Windows XP machine, so I am pretty sure the
    > > problem is not port settings. Excel 2003 seems to implement the

    > translation
    > > of the string differently than Excel 2000.
    > >
    > > Charlie
    > >
    > > "NickHK" wrote:
    > >
    > > > It would depend on what you code is currently doing.
    > > >
    > > > NickHK
    > > >
    > > > "Charlie" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > digital
    > > > > multimeter and generates a strip chart. It works well in Excel 2000,

    > but
    > > > > gives me some problems in Excel 2003. Essentially, when reading one
    > > > meter,
    > > > > the macro reads garbage (it looks like hex being interpreted as

    > ascii).
    > > > > Other software (provided by the multimeter manufacturer) communicates

    > well
    > > > > with the Windows XP system. The macro works well with a different
    > > > > multimeter. It appears to be a problem with how Excel 2003 interprets

    > the
    > > > > incoming data string. How can I go about correcting this?
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Charlie
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    Here's the code:

    XMCommCRC1.CommPort = 1
    XMCommCRC1.Settings = "9600,n,8,1"
    XMCommCRC1.PortOpen = True

    'Get meter ID

    XMCommCRC1.Output = "ID" & vbCr

    'Wait for 1 second to allow meter to respond

    NewHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 1
    waitTime = TimeSerial(NewHour, newMinute, newSecond)
    Application.Wait waitTime

    ' get results and format them

    Buffer = XMCommCRC1.InputData
    ActiveSheet.Cells(1, 1).Value = Buffer
    ActiveSheet.Columns("A").Parse _
    parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    Destination:=ActiveSheet.Range("B1")

    XMCommCRC1.PortOpen = False

    And the output in Excel 2000:

    "0
    FLUKE 89, V1.01,75200615
    " "0
    " FLUKE 89 , V1.01, 75200615

    And the output in Excel 2003:

    "ÿ
    FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    " "ÿ
    " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ

    When I use the same code with a second meter, modifying the appropriate port
    settings to suit the other meter, I get good results from both Excel 2000 and
    Excel 2003. When I use the same seriasl interface with the Fluke meter,
    utilizing Fluke software, I get good communications. The problem appears to
    be with the way Excel 2003 interprets the information from the Fluke meter.

    Charlie

    "NickHK" wrote:

    > But without your code it still unknown where a problem may lie.
    >
    > NickHK
    >
    > "Charlie" <[email protected]> wrote in message
    > news:[email protected]...
    > > NickHK-
    > > Code reads a string from the com port, writes it to a cell. The string is
    > > then parsed and values extracted. One version of the code works well with
    > > one meter on Windows XP, both versions work well on Windows 98. Actually,
    > > the only difference between the two versions is that the port settings are
    > > different for the two meters. The meter that gives me garbage talks to

    > the
    > > manufacturer's software on the Windows XP machine, so I am pretty sure the
    > > problem is not port settings. Excel 2003 seems to implement the

    > translation
    > > of the string differently than Excel 2000.
    > >
    > > Charlie
    > >
    > > "NickHK" wrote:
    > >
    > > > It would depend on what you code is currently doing.
    > > >
    > > > NickHK
    > > >
    > > > "Charlie" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > digital
    > > > > multimeter and generates a strip chart. It works well in Excel 2000,

    > but
    > > > > gives me some problems in Excel 2003. Essentially, when reading one
    > > > meter,
    > > > > the macro reads garbage (it looks like hex being interpreted as

    > ascii).
    > > > > Other software (provided by the multimeter manufacturer) communicates

    > well
    > > > > with the Windows XP system. The macro works well with a different
    > > > > multimeter. It appears to be a problem with how Excel 2003 interprets

    > the
    > > > > incoming data string. How can I go about correcting this?
    > > >
    > > >
    > > >

    >
    >
    >


  7. #7
    Charlie
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    Here's the code:

    XMCommCRC1.CommPort = 1
    XMCommCRC1.Settings = "9600,n,8,1"
    XMCommCRC1.PortOpen = True

    'Get meter ID

    XMCommCRC1.Output = "ID" & vbCr

    'Wait for 1 second to allow meter to respond

    NewHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 1
    waitTime = TimeSerial(NewHour, newMinute, newSecond)
    Application.Wait waitTime

    ' get results and format them

    Buffer = XMCommCRC1.InputData
    ActiveSheet.Cells(1, 1).Value = Buffer
    ActiveSheet.Columns("A").Parse _
    parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    Destination:=ActiveSheet.Range("B1")

    XMCommCRC1.PortOpen = False

    And the output in Excel 2000:

    "0
    FLUKE 89, V1.01,75200615
    " "0
    " FLUKE 89 , V1.01, 75200615

    And the output in Excel 2003:

    "ÿ
    FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    " "ÿ
    " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ

    When I use the same code with a second meter, modifying the appropriate port
    settings to suit the other meter, I get good results from both Excel 2000 and
    Excel 2003. When I use the same seriasl interface with the Fluke meter,
    utilizing Fluke software, I get good communications. The problem appears to
    be with the way Excel 2003 interprets the information from the Fluke meter.

    Charlie

    "NickHK" wrote:

    > But without your code it still unknown where a problem may lie.
    >
    > NickHK
    >
    > "Charlie" <[email protected]> wrote in message
    > news:[email protected]...
    > > NickHK-
    > > Code reads a string from the com port, writes it to a cell. The string is
    > > then parsed and values extracted. One version of the code works well with
    > > one meter on Windows XP, both versions work well on Windows 98. Actually,
    > > the only difference between the two versions is that the port settings are
    > > different for the two meters. The meter that gives me garbage talks to

    > the
    > > manufacturer's software on the Windows XP machine, so I am pretty sure the
    > > problem is not port settings. Excel 2003 seems to implement the

    > translation
    > > of the string differently than Excel 2000.
    > >
    > > Charlie
    > >
    > > "NickHK" wrote:
    > >
    > > > It would depend on what you code is currently doing.
    > > >
    > > > NickHK
    > > >
    > > > "Charlie" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > digital
    > > > > multimeter and generates a strip chart. It works well in Excel 2000,

    > but
    > > > > gives me some problems in Excel 2003. Essentially, when reading one
    > > > meter,
    > > > > the macro reads garbage (it looks like hex being interpreted as

    > ascii).
    > > > > Other software (provided by the multimeter manufacturer) communicates

    > well
    > > > > with the Windows XP system. The macro works well with a different
    > > > > multimeter. It appears to be a problem with how Excel 2003 interprets

    > the
    > > > > incoming data string. How can I go about correcting this?
    > > >
    > > >
    > > >

    >
    >
    >


  8. #8
    Charlie
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    Here's the code:

    XMCommCRC1.CommPort = 1
    XMCommCRC1.Settings = "9600,n,8,1"
    XMCommCRC1.PortOpen = True

    'Get meter ID

    XMCommCRC1.Output = "ID" & vbCr

    'Wait for 1 second to allow meter to respond

    NewHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 1
    waitTime = TimeSerial(NewHour, newMinute, newSecond)
    Application.Wait waitTime

    ' get results and format them

    Buffer = XMCommCRC1.InputData
    ActiveSheet.Cells(1, 1).Value = Buffer
    ActiveSheet.Columns("A").Parse _
    parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    Destination:=ActiveSheet.Range("B1")

    XMCommCRC1.PortOpen = False

    And the output in Excel 2000:

    "0
    FLUKE 89, V1.01,75200615
    " "0
    " FLUKE 89 , V1.01, 75200615

    And the output in Excel 2003:

    "ÿ
    FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    " "ÿ
    " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ

    When I use the same code with a second meter, modifying the appropriate port
    settings to suit the other meter, I get good results from both Excel 2000 and
    Excel 2003. When I use the same seriasl interface with the Fluke meter,
    utilizing Fluke software, I get good communications. The problem appears to
    be with the way Excel 2003 interprets the information from the Fluke meter.

    Charlie

    "NickHK" wrote:

    > But without your code it still unknown where a problem may lie.
    >
    > NickHK
    >
    > "Charlie" <[email protected]> wrote in message
    > news:[email protected]...
    > > NickHK-
    > > Code reads a string from the com port, writes it to a cell. The string is
    > > then parsed and values extracted. One version of the code works well with
    > > one meter on Windows XP, both versions work well on Windows 98. Actually,
    > > the only difference between the two versions is that the port settings are
    > > different for the two meters. The meter that gives me garbage talks to

    > the
    > > manufacturer's software on the Windows XP machine, so I am pretty sure the
    > > problem is not port settings. Excel 2003 seems to implement the

    > translation
    > > of the string differently than Excel 2000.
    > >
    > > Charlie
    > >
    > > "NickHK" wrote:
    > >
    > > > It would depend on what you code is currently doing.
    > > >
    > > > NickHK
    > > >
    > > > "Charlie" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > digital
    > > > > multimeter and generates a strip chart. It works well in Excel 2000,

    > but
    > > > > gives me some problems in Excel 2003. Essentially, when reading one
    > > > meter,
    > > > > the macro reads garbage (it looks like hex being interpreted as

    > ascii).
    > > > > Other software (provided by the multimeter manufacturer) communicates

    > well
    > > > > with the Windows XP system. The macro works well with a different
    > > > > multimeter. It appears to be a problem with how Excel 2003 interprets

    > the
    > > > > incoming data string. How can I go about correcting this?
    > > >
    > > >
    > > >

    >
    >
    >


  9. #9
    Charlie
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    Here's the code:

    XMCommCRC1.CommPort = 1
    XMCommCRC1.Settings = "9600,n,8,1"
    XMCommCRC1.PortOpen = True

    'Get meter ID

    XMCommCRC1.Output = "ID" & vbCr

    'Wait for 1 second to allow meter to respond

    NewHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 1
    waitTime = TimeSerial(NewHour, newMinute, newSecond)
    Application.Wait waitTime

    ' get results and format them

    Buffer = XMCommCRC1.InputData
    ActiveSheet.Cells(1, 1).Value = Buffer
    ActiveSheet.Columns("A").Parse _
    parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    Destination:=ActiveSheet.Range("B1")

    XMCommCRC1.PortOpen = False

    And the output in Excel 2000:

    "0
    FLUKE 89, V1.01,75200615
    " "0
    " FLUKE 89 , V1.01, 75200615

    And the output in Excel 2003:

    "ÿ
    FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    " "ÿ
    " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ

    When I use the same code with a second meter, modifying the appropriate port
    settings to suit the other meter, I get good results from both Excel 2000 and
    Excel 2003. When I use the same seriasl interface with the Fluke meter,
    utilizing Fluke software, I get good communications. The problem appears to
    be with the way Excel 2003 interprets the information from the Fluke meter.

    Charlie

    "NickHK" wrote:

    > But without your code it still unknown where a problem may lie.
    >
    > NickHK
    >
    > "Charlie" <[email protected]> wrote in message
    > news:[email protected]...
    > > NickHK-
    > > Code reads a string from the com port, writes it to a cell. The string is
    > > then parsed and values extracted. One version of the code works well with
    > > one meter on Windows XP, both versions work well on Windows 98. Actually,
    > > the only difference between the two versions is that the port settings are
    > > different for the two meters. The meter that gives me garbage talks to

    > the
    > > manufacturer's software on the Windows XP machine, so I am pretty sure the
    > > problem is not port settings. Excel 2003 seems to implement the

    > translation
    > > of the string differently than Excel 2000.
    > >
    > > Charlie
    > >
    > > "NickHK" wrote:
    > >
    > > > It would depend on what you code is currently doing.
    > > >
    > > > NickHK
    > > >
    > > > "Charlie" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > digital
    > > > > multimeter and generates a strip chart. It works well in Excel 2000,

    > but
    > > > > gives me some problems in Excel 2003. Essentially, when reading one
    > > > meter,
    > > > > the macro reads garbage (it looks like hex being interpreted as

    > ascii).
    > > > > Other software (provided by the multimeter manufacturer) communicates

    > well
    > > > > with the Windows XP system. The macro works well with a different
    > > > > multimeter. It appears to be a problem with how Excel 2003 interprets

    > the
    > > > > incoming data string. How can I go about correcting this?
    > > >
    > > >
    > > >

    >
    >
    >


  10. #10
    NickHK
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    I can only suggest you read the .Inputdata into a byte array for the various
    meter/excel version combinations and check the byte values.
    At least then you can confirm that the problem is Excel related rather than
    Comm control, OS, meter or otherwise based.

    NickHK

    "Charlie" <[email protected]> wrote in message
    news:[email protected]...
    > Here's the code:
    >
    > XMCommCRC1.CommPort = 1
    > XMCommCRC1.Settings = "9600,n,8,1"
    > XMCommCRC1.PortOpen = True
    >
    > 'Get meter ID
    >
    > XMCommCRC1.Output = "ID" & vbCr
    >
    > 'Wait for 1 second to allow meter to respond
    >
    > NewHour = Hour(Now())
    > newMinute = Minute(Now())
    > newSecond = Second(Now()) + 1
    > waitTime = TimeSerial(NewHour, newMinute, newSecond)
    > Application.Wait waitTime
    >
    > ' get results and format them
    >
    > Buffer = XMCommCRC1.InputData
    > ActiveSheet.Cells(1, 1).Value = Buffer
    > ActiveSheet.Columns("A").Parse _
    > parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    > Destination:=ActiveSheet.Range("B1")
    >
    > XMCommCRC1.PortOpen = False
    >
    > And the output in Excel 2000:
    >
    > "0
    > FLUKE 89, V1.01,75200615
    > " "0
    > " FLUKE 89 , V1.01, 75200615
    >
    > And the output in Excel 2003:
    >
    > "ÿ
    > FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    > " "ÿ
    > " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ
    >
    > When I use the same code with a second meter, modifying the appropriate

    port
    > settings to suit the other meter, I get good results from both Excel 2000

    and
    > Excel 2003. When I use the same seriasl interface with the Fluke meter,
    > utilizing Fluke software, I get good communications. The problem appears

    to
    > be with the way Excel 2003 interprets the information from the Fluke

    meter.
    >
    > Charlie
    >
    > "NickHK" wrote:
    >
    > > But without your code it still unknown where a problem may lie.
    > >
    > > NickHK
    > >
    > > "Charlie" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > NickHK-
    > > > Code reads a string from the com port, writes it to a cell. The

    string is
    > > > then parsed and values extracted. One version of the code works well

    with
    > > > one meter on Windows XP, both versions work well on Windows 98.

    Actually,
    > > > the only difference between the two versions is that the port settings

    are
    > > > different for the two meters. The meter that gives me garbage talks

    to
    > > the
    > > > manufacturer's software on the Windows XP machine, so I am pretty sure

    the
    > > > problem is not port settings. Excel 2003 seems to implement the

    > > translation
    > > > of the string differently than Excel 2000.
    > > >
    > > > Charlie
    > > >
    > > > "NickHK" wrote:
    > > >
    > > > > It would depend on what you code is currently doing.
    > > > >
    > > > > NickHK
    > > > >
    > > > > "Charlie" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > > digital
    > > > > > multimeter and generates a strip chart. It works well in Excel

    2000,
    > > but
    > > > > > gives me some problems in Excel 2003. Essentially, when reading

    one
    > > > > meter,
    > > > > > the macro reads garbage (it looks like hex being interpreted as

    > > ascii).
    > > > > > Other software (provided by the multimeter manufacturer)

    communicates
    > > well
    > > > > > with the Windows XP system. The macro works well with a different
    > > > > > multimeter. It appears to be a problem with how Excel 2003

    interprets
    > > the
    > > > > > incoming data string. How can I go about correcting this?
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  11. #11
    NickHK
    Guest

    Re: How to port macros from Excel 2000 to Excel 2003

    I can only suggest you read the .Inputdata into a byte array for the various
    meter/excel version combinations and check the byte values.
    At least then you can confirm that the problem is Excel related rather than
    Comm control, OS, meter or otherwise based.

    NickHK

    "Charlie" <[email protected]> wrote in message
    news:[email protected]...
    > Here's the code:
    >
    > XMCommCRC1.CommPort = 1
    > XMCommCRC1.Settings = "9600,n,8,1"
    > XMCommCRC1.PortOpen = True
    >
    > 'Get meter ID
    >
    > XMCommCRC1.Output = "ID" & vbCr
    >
    > 'Wait for 1 second to allow meter to respond
    >
    > NewHour = Hour(Now())
    > newMinute = Minute(Now())
    > newSecond = Second(Now()) + 1
    > waitTime = TimeSerial(NewHour, newMinute, newSecond)
    > Application.Wait waitTime
    >
    > ' get results and format them
    >
    > Buffer = XMCommCRC1.InputData
    > ActiveSheet.Cells(1, 1).Value = Buffer
    > ActiveSheet.Columns("A").Parse _
    > parseLine:="[xx][xxxxxxxx][xxxxxxxx][xxxxxxxxxx]", _
    > Destination:=ActiveSheet.Range("B1")
    >
    > XMCommCRC1.PortOpen = False
    >
    > And the output in Excel 2000:
    >
    > "0
    > FLUKE 89, V1.01,75200615
    > " "0
    > " FLUKE 89 , V1.01, 75200615
    >
    > And the output in Excel 2003:
    >
    > "ÿ
    > FÿKÿÿ;ÿÿÿÿ?.0ÿ/7ÿÿ0ÿÿ?5ÿÿ
    > " "ÿ
    > " FÿKÿÿ;ÿ ÿÿÿ?.0ÿ/ 7ÿÿ0ÿÿ?5ÿÿ
    >
    > When I use the same code with a second meter, modifying the appropriate

    port
    > settings to suit the other meter, I get good results from both Excel 2000

    and
    > Excel 2003. When I use the same seriasl interface with the Fluke meter,
    > utilizing Fluke software, I get good communications. The problem appears

    to
    > be with the way Excel 2003 interprets the information from the Fluke

    meter.
    >
    > Charlie
    >
    > "NickHK" wrote:
    >
    > > But without your code it still unknown where a problem may lie.
    > >
    > > NickHK
    > >
    > > "Charlie" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > NickHK-
    > > > Code reads a string from the com port, writes it to a cell. The

    string is
    > > > then parsed and values extracted. One version of the code works well

    with
    > > > one meter on Windows XP, both versions work well on Windows 98.

    Actually,
    > > > the only difference between the two versions is that the port settings

    are
    > > > different for the two meters. The meter that gives me garbage talks

    to
    > > the
    > > > manufacturer's software on the Windows XP machine, so I am pretty sure

    the
    > > > problem is not port settings. Excel 2003 seems to implement the

    > > translation
    > > > of the string differently than Excel 2000.
    > > >
    > > > Charlie
    > > >
    > > > "NickHK" wrote:
    > > >
    > > > > It would depend on what you code is currently doing.
    > > > >
    > > > > NickHK
    > > > >
    > > > > "Charlie" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I wrote a macro in VB for applications in Excel 2000 that reads a

    > > digital
    > > > > > multimeter and generates a strip chart. It works well in Excel

    2000,
    > > but
    > > > > > gives me some problems in Excel 2003. Essentially, when reading

    one
    > > > > meter,
    > > > > > the macro reads garbage (it looks like hex being interpreted as

    > > ascii).
    > > > > > Other software (provided by the multimeter manufacturer)

    communicates
    > > well
    > > > > > with the Windows XP system. The macro works well with a different
    > > > > > multimeter. It appears to be a problem with how Excel 2003

    interprets
    > > the
    > > > > > incoming data string. How can I go about correcting this?
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




+ 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