How to open excel in read only mode?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vaibhav10
    New Member
    • Jul 2013
    • 1

    How to open excel in read only mode?

    following code use to open ms excel but its open in write mode. I want to open in read only mode.

    Code:
    // Call Documents.Open() to open C:\Doc1.doc
          IDispatch *pDoc;
          {
                VARIANT result;
                VariantInit(&result);
                VARIANT x;
                x.vt = VT_BSTR;
                x.bstrVal = ::SysAllocString(L"C:\\Doc1.doc");
    
                AutoWrap(DISPATCH_METHOD, &result, pDocs, L"Open", 1, x);
                pDoc = result.pdispVal;
                SysFreeString(x.bstrVal);
          }
    Last edited by Rabbit; Jul 3 '13, 04:48 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code.

    This doesn't look like VBA code, which is what Excel uses. Let us know what language you're using and we can move it to the correct forum.

    Comment

    Working...