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