help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions on Excel COM object: "Visible" & "Activate" members of a _


From: PhilipNienhuis
Subject: Re: Questions on Excel COM object: "Visible" & "Activate" members of a _Worksheet object
Date: Thu, 25 Oct 2018 02:44:37 -0500 (CDT)

Victor wrote
> Hi,
> I'm testing the script below on two Excel files. When I ran the script on
> the first file, the script failed on the command /v = exlsheet1.visible/
> with an error message 
> /error: com_get: unknown property/method name `visible'/ 
> 
> /exl = actxserver('Excel.Application')
> path = 'C:\Users\test.xlsx'
> exlFile = exl.workBooks.open(path,0,true) 
> WorkSheets = get(exl, 'Sheets')
> exlsheet1 = WorkSheets.item(1)
> v = exlsheet1.visible/
> 
> 
> However, the same script was successfully executed on the 2nd Excel file.
> The major difference between the two files is the that the first one
> contains many macros and the second doesn't.  
> 
> I also experimented with the method "Activate" of a _Worksheet object and
> found the same issue. The command /exlsheet1.activate/ was executed
> successfully on the second file but returned an error message on the first
> file that contains many macros. Does anyone know how  presence of macros
> could affect the availability of the property/method (such as "Visible"
> and
> "Activate") of a _Worksheet object? 

This question rather pertains to VBA programming, not so much to Octave code
AFAICS. You may have more luck asking on Stackoverflow.
FWIW, my own experience with the COM interface for spreadsheet I/O in the
windows package is that the latter is fairly robust but doesn't always work
in all cases when compared to Matlab (it works in -say- 99.5 % of the code I
tried).
That said, does your code work in Matlab?

Philip



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]