Author Topic: How to open Excel documents as ReadOnly in Visual-Lisp  (Read 2029 times)

0 Members and 1 Guest are viewing this topic.

ahankhah

  • Mosquito
  • Posts: 19
How to open Excel documents as ReadOnly in Visual-Lisp
« on: March 05, 2021, 06:32:02 AM »


Hi all,

I know the Autolisp functions to open an Excel document:

Code - Auto/Visual Lisp: [Select]
  1. (defun MT:Open-Excel-File (%ExcelFileName%)
  2.  (vlax-invoke-method (vlax-get-property (vlax-get-or-create-object "Excel.Application") 'WorkBooks) 'Open %ExcelFileName%)
  3. )

But don't know how to open it as ReadOnly.

How is it possible?

 

I appreciate any help. :smitten:

VovKa

  • Water Moccasin
  • Posts: 1629
  • Ukraine
Re: How to open Excel documents as ReadOnly in Visual-Lisp
« Reply #1 on: March 05, 2021, 06:52:38 AM »
Code: [Select]
'Open %ExcelFileName% nil t

ahankhah

  • Mosquito
  • Posts: 19
Re: How to open Excel documents as ReadOnly in Visual-Lisp
« Reply #2 on: March 05, 2021, 07:43:57 AM »
Code: [Select]
'Open %ExcelFileName% nil t

Thank you VovKa for your advise. Meanwhile I did "Try and Error" and found same result. The code can be as following:

Code - Auto/Visual Lisp: [Select]
  1.     (defun MT:Open-Excel-File (%ExcelFileName%)
  2.      (vlax-invoke-method (vlax-get-property (vlax-get-or-create-object "Excel.Application") 'WorkBooks) 'Open %ExcelFileName% nil T)
  3.     )

Again, I appreciate your help.

d2010

  • Bull Frog
  • Posts: 326
Re: How to open Excel documents as ReadOnly in Visual-Lisp
« Reply #3 on: March 06, 2021, 02:23:43 PM »
I do not why, the autodesk.forum.lisp, spam  all Topics with Lisp+Microsoft Excel.
If you sharing VLisp+Excel functions/ then you post Copyright-violations, you are enemy of Microsoft-Copyrights?!
If you sharing VLisp+Excel functions/ then you became Hacker.
 :whistling:
Code: [Select]
'Open %ExcelFileName% nil t
« Last Edit: March 06, 2021, 02:26:45 PM by d2010 »