Resize child windows in Excel
Keywords:
Question:
The Function WinPlace doesn't seem to affect child windows. I need to change child window sizes in Excel.I recorded how to do this in Excel VBA:
Windows("Book1").Activate With ActiveWindow .Top = 231.25 .Left = 7.75 End With With ActiveWindow .Width = 267.75 .Height = 415.5 End WithCan you help me to feed translate this VB code to WinBatch OLE commands?
Answer:
Try This
source_xls = "C:\WINDOWS\DESKTOP\OLE-ADO-ADOX\OLE\OLE_types.xls" ExcelWS = ObjectOpen("Excel.Application") ; Open Excel using values from Registry. ; The path to Excel is found from the Registry. ; Not in Registry? Reinstall Excel, or modify registry ; from another WinBatch script. Be careful. ExcelWS.visible = @true ; Property set to visible to see Excel. Otherwise ; Excel will start and run hidden. EWB = ExcelWS.Workbooks EWB.Open (source_xls) WBA = ExcelWS.ActiveWorkbook WBA.Activate WIN = WBA.Windows(1) WINA = WIN.Activate WINACT = ExcelWS.ActiveWindow WINACT.Top = 231.25 WINACT.Left = 7.75 WINACT.Width = 267 WINACT.Height = 415.5 exit
Article ID: W14931