我正在尝试创建一个基本上进入网站的宏,引入两个必填信息,然后将查询结果复制回我的excel。
由于我在宏方面缺乏一些技能,因此我仅通过“记录宏”来做到这一点。一切顺利,除了两件事:
作为辅助,网站为https://ovc.catastro.meh.es/ovcservweb/ovcswlocalizacionrc/ovccoordenadas.asmx?op=Consulta_CPMRC
我要介绍的值是:
SRS:EPSG:4230 RC:9559313CF7695N
所有“搜索”中的SRS都相同,但RC会发生变化(将引入大约2000个RC)
Application.ScreenUpdating = False
Range("A3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("D3").Select
Selection.Copy
Range("C3").Select
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Range("E3").Select
ActiveCell.FormulaR1C1 = _
"<consulta_coordenadas xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://www.catastro.meh.es/"">" & Chr(10) & "<control>" & Chr(10) & "<cucoor>1</cucoor>" & Chr(10) & "<cuerr>0</cuerr>" & Chr(10) & "</control>" & Chr(10) & "<coordenadas>" & Chr(10) & "<coord>" & Chr(10) & "<pc>" & Chr(10) & "<pc1>9236807</pc1>" & Chr(10) & "<pc2>YK3293N</pc2>" & Chr(10) & "</pc>" & Chr(10) & "<geo>" & Chr(10) & "<xcen>-0.2006669898936</xcen>" & Chr(10) & "<ycen>39.9282269230232</ycen>" & Chr(10) & "<srs>EPSG:" & _
"4230</srs>" & Chr(10) & "</geo>" & Chr(10) & "<ldt>CL CONCILI VATICA II (DEL) 26 BETXI (CASTELLÓN)</ldt>" & Chr(10) & "</coord>" & Chr(10) & "</coordenadas>" & Chr(10) & "</consulta_coordenadas>" & _
""
Range("E3").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
结尾为 结束