liorde Honored Contributor.
Honored Contributor.
238 views

UFT work with Excel 2013

Hello friends.
I need to interact with an Excel file (version 2013) which I download from a certain web site. I do not know the file's name since it is generated in runtime. However, I need to interct with it, delete some rows and then save it under a specific name.

1. How can I determine which file is currently open?
2. How can I overcome the technical difficulty of the file being "protected" and having to press "enable editing" as a user, but thru Excel object commands
3. I noticed something-when the file is still "untouchable" -> 2 processes of 'Excel.exe' appear in the task manager. After I press "enable editing", only 1 process appears - why is this so ??

 

Please advise.
    Thank-you.

0 Likes
2 Replies
RajkumarR Outstanding Contributor.
Outstanding Contributor.

Re: UFT work with Excel 2013

Here you go 🙂

'Get Open workbook
Set OpenWorkbook = GetObject( ,"Excel.Application")
' Enable only if protected
If  OpenWorkbook.Application.ProtectedViewWindows.Count > 0 Then
    OpenWorkbook.Application.ActiveProtectedViewWindow.Edit
End If
_____________________
Rajkumar Rajangam
0 Likes
liorde Honored Contributor.
Honored Contributor.

Re: UFT work with Excel 2013

Thenk-you  Rajkumar.
This solution does not do anyting actually, as I get an empty object from this copmmand:

 OpenWorkbook = GetObject( ,"Excel.Application")
' Enable only if protected

Besides the face tht UFT doesnt like this phrase:

 GetObject( ,"Excel.Application")

Reports a syntax  error  for it.

any ideas ??

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.