Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Set password on existing excel application

Set password on existing excel application

Scheduled Pinned Locked Moved Visual Basic
visual-studiocomsecurityhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zenithmaximus
    wrote on last edited by
    #1

    Hi, I've been trying to set security password on a existing excel, and been trying these codes: Im Using COM for Excel 5.0 Public myExcel As Excel.Application Public myBook As Excel.Workbook Public mySheet As Excel.Worksheet myExcel = CreateObject("Excel.Application") xlsFilename = "C:\samp.xls" myBook = myExcel.Workbooks.open(xlsFilename) myBook.SaveAs(xlsFilename, password:=txt_password.Text) error that i'm getting is "Member not found" and points to myBook = myExcel.Workbooks.open(xlsFilename) when i try to look at the intellisense after workbooks. the only thing that appears is Gettype. Any other approach? or recommendation for this would be appreciated. Thanks.

    -::maximus::-

    O 1 Reply Last reply
    0
    • Z zenithmaximus

      Hi, I've been trying to set security password on a existing excel, and been trying these codes: Im Using COM for Excel 5.0 Public myExcel As Excel.Application Public myBook As Excel.Workbook Public mySheet As Excel.Worksheet myExcel = CreateObject("Excel.Application") xlsFilename = "C:\samp.xls" myBook = myExcel.Workbooks.open(xlsFilename) myBook.SaveAs(xlsFilename, password:=txt_password.Text) error that i'm getting is "Member not found" and points to myBook = myExcel.Workbooks.open(xlsFilename) when i try to look at the intellisense after workbooks. the only thing that appears is Gettype. Any other approach? or recommendation for this would be appreciated. Thanks.

      -::maximus::-

      O Offline
      O Offline
      Ostrich22
      wrote on last edited by
      #2

      In office XP I do it like so: xlSheet.Protect(Password:="SomePassWord", _ DrawingObjects:=True, _ Contents:=True, _ Scenarios:=True, _ UserInterfaceOnly:=True, _ AllowFormattingCells:=True, _ AllowFormattingColumns:=False, _ AllowFormattingRows:=False, _ AllowInsertingColumns:=False, _ AllowInsertingRows:=True, _ AllowInsertingHyperlinks:=False, _ AllowDeletingColumns:=False, _ AllowDeletingRows:=True, _ AllowSorting:=True, _ AllowFiltering:=True, _ AllowUsingPivotTables:=False) Its not necessary to have all the following settings, but I like to leave them there

      Z 1 Reply Last reply
      0
      • O Ostrich22

        In office XP I do it like so: xlSheet.Protect(Password:="SomePassWord", _ DrawingObjects:=True, _ Contents:=True, _ Scenarios:=True, _ UserInterfaceOnly:=True, _ AllowFormattingCells:=True, _ AllowFormattingColumns:=False, _ AllowFormattingRows:=False, _ AllowInsertingColumns:=False, _ AllowInsertingRows:=True, _ AllowInsertingHyperlinks:=False, _ AllowDeletingColumns:=False, _ AllowDeletingRows:=True, _ AllowSorting:=True, _ AllowFiltering:=True, _ AllowUsingPivotTables:=False) Its not necessary to have all the following settings, but I like to leave them there

        Z Offline
        Z Offline
        zenithmaximus
        wrote on last edited by
        #3

        Office XP has Interop, but im running this application in NT... if I can have it work without installing DLLs would be much better.

        -::maximus::-

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups