KF5WGB Posted September 20, 2023 Posted September 20, 2023 Hi everybody, I looked through the forum and some guys, way way back, had the same problem but iI can not find a solution. I used this Function for years without a problem and now it throws an error. The attached pic is from running the compiled .exe file. Running the Func SolarData() itself gives the $oXML^ ERROR . SolarData() Func SolarData() ;If _IsInternetConnected() = True Then Global $oXML = ObjCreate("Microsoft.XMLHTTP") $oXML.Open("GET", "http://www.hamqsl.com/solarxml.php", 0) $oXML.Send ; Find Sunspots $SSCount1 = StringInStr($oXML.responsetext, "<sunspots") $SSCount2 = StringInStr($oXML.responsetext, "</sunspots") $SSlen = $SSCount2 - ($SSCount1 + 10) Global $SS = StringMid($oXML.responsetext, ($SSCount1 + 10), $SSlen) ; Find SolarFlux $SFCount1 = StringInStr($oXML.responsetext, "<solarflux") $SFCount2 = StringInStr($oXML.responsetext, "</solarflux") $FSlen = $SFCount2 - ($SFCount1 + 11) Global $SFI = StringMid($oXML.responsetext, ($SFCount1 + 11), $FSlen) ;Find A index $AiCount1 = StringInStr($oXML.responsetext, "<aindex") $AICount2 = StringInStr($oXML.responsetext, "</aindex") $AIlen = $AICount2 - ($AiCount1 + 8) Global $AI = StringMid($oXML.responsetext, ($AiCount1 + 8), $AIlen) ;Find K index $KICount1 = StringInStr($oXML.responsetext, "<kindex") $KICount2 = StringInStr($oXML.responsetext, "</kindex") $KIlen = $KICount2 - ($KICount1 + 8) Global $KI = StringMid($oXML.responsetext, ($KICount1 + 8), $KIlen) ;~ TrayItemSetText($SolarFlux, "Solar Data: SSN:" & $SS & " SFI:" & $SFI & " A:" & $AI & " K:" & $KI) ;EndIf EndFunc ;==>SolarData C:\Users\KF5WGB\Desktop\nextcloud copy\A2Q+_Dev\solardata.au3" (19) : ==> The requested action with this object has failed.: $oXML.Send $oXML^ ERROR Is this obsolete or did M$ change something on how to create XML objects? Global $oXML = ObjCreate("Microsoft.XMLHTTP") $oXML.Open("GET", "http://www.hamqsl.com/solarxml.php", 0) $oXML.Send Thanks for any advice. 73 de KF5WGB
Solution KaFu Posted September 20, 2023 Solution Posted September 20, 2023 https://stackoverflow.com/questions/46247627/excel-vba-send-to-msxml2-xmlhttp-does-not-work This works for me: SolarData() Func SolarData() ;If _IsInternetConnected() = True Then Global $oXML = ObjCreate("MSXML2.ServerXMLHTTP") $oXML.Open("GET", "http://www.hamqsl.com/solarxml.php",0) $oXML.Send ; Find Sunspots $SSCount1 = StringInStr($oXML.responsetext, "<sunspots") $SSCount2 = StringInStr($oXML.responsetext, "</sunspots") $SSlen = $SSCount2 - ($SSCount1 + 10) Global $SS = StringMid($oXML.responsetext, ($SSCount1 + 10), $SSlen) ; Find SolarFlux $SFCount1 = StringInStr($oXML.responsetext, "<solarflux") $SFCount2 = StringInStr($oXML.responsetext, "</solarflux") $FSlen = $SFCount2 - ($SFCount1 + 11) Global $SFI = StringMid($oXML.responsetext, ($SFCount1 + 11), $FSlen) ;Find A index $AiCount1 = StringInStr($oXML.responsetext, "<aindex") $AICount2 = StringInStr($oXML.responsetext, "</aindex") $AIlen = $AICount2 - ($AiCount1 + 8) Global $AI = StringMid($oXML.responsetext, ($AiCount1 + 8), $AIlen) ;Find K index $KICount1 = StringInStr($oXML.responsetext, "<kindex") $KICount2 = StringInStr($oXML.responsetext, "</kindex") $KIlen = $KICount2 - ($KICount1 + 8) Global $KI = StringMid($oXML.responsetext, ($KICount1 + 8), $KIlen) ; TrayItemSetText($SolarFlux, "Solar Data: SSN:" & $SS & " SFI:" & $SFI & " A:" & $AI & " K:" & $KI) MsgBox(0,"","Solar Data: SSN:" & $SS & " SFI:" & $SFI & " A:" & $AI & " K:" & $KI) ;EndIf EndFunc ;==>SolarData OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now