Results 1 to 4 of 4

Thread: Replace

  1. #1
    Join Date
    Oct 2004
    Location
    uk, west midlands
    Posts
    5

    Replace

    Hi im trying to use "replace" however i think it is only available with "Microsoft Access 9.0 Object Library" and im using A97, all my users are using A97, does anyone know of a method of either using this command, or using the reference without having to install it on everyones PC? can you embed libraries in your db ?

    Trying to do:

    Replace(strPath...

  2. #2
    Join Date
    Sep 2003
    Location
    in my cube
    Posts
    95
    Function MyReplaceFunction(SourceString As String, String1 As String, String2 As String) As String
    Dim m_Excel As Excel.Application
    Set m_Excel = New Excel.Application

    MyReplaceFunction = m_Excel.WorksheetFunction.Substitute(SourceString, String1, String2)
    m_Excel.Quit
    Set m_Excel = Nothing
    End Function




    Sub UseMyReplaceFunction()
    Dim myString As String
    myString = "Original Source String"
    myString = MyReplaceFunction(myString, "Source", "User")
    Debug.Print myString
    End Sub

  3. #3
    Join Date
    Feb 2003
    Posts
    1,048
    Whoa!! You don't need to create an Excel application every time you want to replace a string!!!

    Follow this "How to" article on MSDN:

    http://support.microsoft.com/default...b;en-us;109330

  4. #4
    Join Date
    Sep 2003
    Location
    in my cube
    Posts
    95
    My first answer was going to be "make everybody upgrade" but that works too.

Posting Permissions

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