Results 1 to 6 of 6
  1. #1
    atzdgreat is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2019
    Posts
    27

    Server threw an Exception

    i used to run this in my pc and it works fine. but when i try to run this at another pc. it wont work. it says Run-time error '-2147417851 (80010105) Automation Error. The server threw an exception.



    Code:
        Dim oWSHShell As Object
        Dim GetDesktop As String
        Dim objWorkbook As Workbook
        Dim Rngdata As Range
        Dim RowCount As Integer
        
        Set oWSHShell = CreateObject("WScript.Shell")
        GetDesktop = oWSHShell.SpecialFolders("Desktop")
        
        Set oWSHShell = Nothing
        
        NewFileSave = GetDesktop & "\" & Format(Date, "MM_DD_YY") & Format(Time, "HH_MM_SSS") & ".xls"
        
        If Dir(NewFileSave) <> "" Then
            SetAttr NewFileSave, vbNormal
            Kill NewFileSave
        End If
        
        BFound = False
        KFound = False
        'OPEN HTML AND CONVERT TO EXCEL
        Set objWorkbook = Workbooks.Open(Me.txtHTMLLocation.Value)
        objWorkbook.SaveAs FileName:=NewFileSave, FileFormat:=56  '<--------Error is pointing at this line
        objWorkbook.Close
        Set objWorkbook = Nothing

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If it works on one pc but not another, then maybe the Excel versions are different?
    There is something familiar about your post - like I've seen it in the last couple of days, yet the time stamp shows today after 10 pm. Have you posted this elsewhere?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    atzdgreat is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2019
    Posts
    27
    nope. this is my first time that i post this question. actually both pc has the same version of office. what should be my approach with the above code.

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    @Micron- I think your thinking of this thread https://www.accessforums.net/showthread.php?t=78767

    It may be relevant in this case also.

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    There are several hits via Google on your error number. Some of those may be relevant.
    I found this by Ron de Bruin ---it may be useful or point you toward further info.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Quote Originally Posted by moke123 View Post
    @Micron- I think your thinking of this thread https://www.accessforums.net/showthread.php?t=78767

    It may be relevant in this case also.
    Can say I didn't see that because ksor is on my ignore list, so I don't see his/her posts.
    Other than maybe trying other formats I don't know the answer. Maybe if you don't specify the format, you'll get prompted, which would probably be a small measure of improvement at this point. I'm presuming that there is no issue with the file path between 2 different pc's (e.g. that the paths are not different).

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculation of Sales Tax with exception.
    By MacMan in forum Access
    Replies: 1
    Last Post: 11-25-2016, 03:21 PM
  2. Certain data exception
    By azhar2006 in forum Queries
    Replies: 2
    Last Post: 03-18-2016, 10:39 AM
  3. Exception in unique field
    By neo651 in forum Access
    Replies: 2
    Last Post: 07-01-2011, 02:23 PM
  4. Exception Reporting - Continued
    By shexe in forum Queries
    Replies: 11
    Last Post: 09-20-2010, 11:20 AM
  5. Exception Reporting
    By shexe in forum Queries
    Replies: 16
    Last Post: 09-09-2010, 09:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums