Results 1 to 11 of 11

Run-time error '-2147417848' Method 'AddFromString'

Threaded View

  1. #1
    Registered User
    Join Date
    09-16-2024
    Location
    Stafford, England
    MS-Off Ver
    2016
    Posts
    6

    Run-time error '-2147417848' Method 'AddFromString'

    Hello
    I am new to VBA and this forum and need a little help please.
    I am supporting users that have hundreds of Excel files that upload to Oracle database using VB and we have recently moved servers so the DB name / URL / SID has changed.
    To make it easy for users I create the following macro which works perfect for me using Excel 2016 but not for another user using Excel 2010 so maybe this is a simple case of change in VB syntax.

    Sub UpdateVBA()
    ' *** Update VBA ***
        Dim component As Object
        For Each component In ActiveWorkbook.VBProject.VBComponents
                Dim module As Object
                Set module = component.CodeModule
               If module.CountOfLines > 0 Then
                           Dim moduleText As String
                moduleText = module.Lines(1, module.CountOfLines)
                moduleText = Replace(moduleText, "//ebseprod.nch.com:443/", "//eurprod.nch.com:443/")
                
                moduleText = Replace(moduleText, "C2039321.EBSEPROD", "NCHEBSDBS151.NCH.COM.EURPROD")
                moduleText = Replace(moduleText, "EBSEPROD", "EURPROD")
                moduleText = Replace(moduleText, "ebseprod", "eurprod")
    
                module.DeleteLines 1, module.CountOfLines
                module.AddFromString moduleText
               End If
        Next
    End Sub
    Administrator's note: Please take the time to review our rules. There aren't many, and they are all important. Our guidelines recommend code tags. I have added them for you this time because you are a new member. --6StringJazzer

    User on 2010 is getting this error
    Run-time error '-2147417848 (80010108)':
    Method 'AddFromString' of object '_CodeModule' failed

    Any help would be appreciated !
    Last edited by 6StringJazzer; 09-16-2024 at 10:21 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Help - Runtime error -2147417848 (80010108) - Method has failed
    By PTSD in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 02-02-2024, 05:40 AM
  2. Run-time error -2147417848 (80010108) Method "Show" of object failed
    By brockbaker27 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-14-2021, 11:03 AM
  3. [SOLVED] Run-time error '-2147417848(80010108) : Method 'Formula' of object 'Range' failed
    By Norlina Deli in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-24-2019, 05:54 AM
  4. [SOLVED] run time error -2147417848 (80010108) Method 'Formula' on object 'Series' failed
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-12-2016, 02:11 PM
  5. Run-time error '-2147417848 (80010108)' Method 'Formula' of object 'Range failed
    By JessKong1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2016, 02:02 AM
  6. Run-time error -2147417848 (80010108) Method Value of object Range failed
    By Arito in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2015, 02:10 PM
  7. Replies: 7
    Last Post: 08-24-2005, 11:05 AM

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