Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

No idea on how to rectify this problem

$
0
0

I have this vba script which I have convert it to autoit script. However it give me error code on:

 ==> The requested action with this object has failed.:
$rng = $oExcel.Range($oExcel.ActiveSheet.PageSetup.PrintArea)
$rng = $oExcel.Range($oExcel.ActiveSheet.PageSetup.PrintArea)^ ERROR
 
This is the original vba scrip:
Sub Test() Dim rng As Range Dim FirstEmptyRow As Long Dim FirstEmptyCol As Integer With ActiveSheet.PageSetup Set rng = Range(.PrintArea) End With FirstEmptyCol = rng.Cells(rng.Cells.Count).Column + 1 FirstEmptyRow = rng.Rows.Count + rng.Cells(1).Row Range(Cells(1, FirstEmptyCol), Cells(1, 256)).EntireColumn.clear Range(Cells(FirstEmptyRow, 1), Cells(Rows.Count, 1)).EntireRow.clear End Sub

 This is the autoit script which I convert from it:

; $rng is to obtain the area of Printarea $rng = $oExcel.Range($oExcel.ActiveSheet.PageSetup.PrintArea) $FirstEmptyCol = $rng.Cells($rng.Cells.Count).Column + 1 $FirstEmptyRow = $rng.Rows.Count + $rng.Cells(1).Row $oExcel.Range($oExcel.Cells(1, $FirstEmptyCol), $oExcel.Cells(1, 256)).EntireColumn.Clear $oExcel.Range($oExcel.Cells($FirstEmptyRow, 1), $oExcel.Cells($oExcel.Rows.Count, 1)).EntireRow.Clear

Anyone got ideas on where is the place I do wrong?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>