일부 서버에서 데이터를 가져 오는 Excel 추가 기능을 사용하고 있습니다. 데이터를 가져오고 범위를 지정하고 형식을 지정하는 간단한 매크로를 작성합니다. 그러나 매크로는 서버에서 데이터를 가져 오지 않습니다. I 셀에 직접 수식을 입력하면 =RTD([Server IP Address],"ALLASSETTICKERINFO")
Excel 용 VBA : 서버 데이터가 업데이트되지 않습니다.
데이터가 리턴되고 다음과 같이
수식이다. 이 매크로를 매크로에 사용하면 데이터가 업데이트되지 않습니다. 공식이 실행 된 후에 매크로 즉시 종료되면, 데이터가 갱신된다
Sub Update_Asset_Info()
Range("A2").Select
' this should be fetching data from a server. Instead it's returning a string "ALLASSETTICKERINFO"
ActiveCell.FormulaR1C1 = "=RTD([Server IP Address],"ALLASSETTICKERINFO")"
' these "resfresh and wait" operations don't seem to help
Range("A2").Select
Calculate
Application.Wait (Now + TimeValue("0:00:03"))
' data is fetched from server if the following code is omitted, but I can't omit it.
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("A2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1)), _
TrailingMinusNumbers:=True
End Sub
유일한 방법이다. 매크로를 종료하기 전에 데이터 서식을 지정하려고하면 대신 서버에서 데이터를 가져 오지 않습니다. 오히려, 세포는 단지 "ALLASSETTICKERINFO"라고 말할 것입니다. 대기 및 새로 고침 명령을 입력하는 것조차 도움이되지 않습니다. 이 문제를 어떻게 해결할 생각인가요?
어둠 속에서 촬영 : 수식을 입력 한 후'Application.RTD.RefreshData'를 시도 했습니까? –