Re: Bug in (scripting) Excel.
Re: Bug in (scripting) Excel.
- Subject: Re: Bug in (scripting) Excel.
- From: David Wignall <email@hidden>
- Date: Mon, 29 Sep 2003 19:10:48 +1200
on 29/9/2003 2:38 AM, Deivy Petrescu at email@hidden wrote:
>
On Sunday, Sep 28, 2003, at 01:56 US/Eastern, David Wignall wrote:
>
>
> <snip>
>
>
>
>> The problem is the command "set ScreenUpdating to false".
>
>
>
> <snip>
>
>
>
>> It is however a drag to not "set ScreenUpdating to false"... It will
>
>> be much slower.
>
>
>
> Late to the thread, so I may have missed this but why do you need to
>
> activate anything? Once the workbooks are open you can just refer to
>
> them by
>
> name or index number
<snip>
>
This actually works. It is not a good solution in my case, because it
>
has to be inserted in every command you have targeting the worksheet,
>
or it will default back to the last workbook opened.
tell Application "Microsoft Excel"
repeat with intWkb from 1 to (count of Workbooks)
repeat with intWks from 1 to (count of Worksheets of Workbook
(intWkb)) --1 line
set var to Value of (CurrentRegion of Range ("A1") of Worksheet
(intWks) of Workbook (intWkb)) --1 line
repeat with varRowValues in var
repeat with varColumnValue in varRowValues
display dialog varColumnValue as string
end repeat
end repeat
end repeat
end repeat
end tell
Easier for me in VBA :)
Sub basObjectWork()
Dim wkb As Workbook
Dim wks As Worksheet
Dim var As Variant
Dim x As Long
Dim y As Long
For Each wkb In Workbooks
For Each wks In wkb.Worksheets
var = wks.Range("A1").CurrentRegion
For x = 1 To UBound(var, 1)
For y = 1 To UBound(var, 2)
Debug.Print wkb.Name; wks.Name; var(x, y)
Next
Next
Next wks
Next wkb
End Sub
--
fwiw
Dave
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.