I have the following:
Dim objExcel As Excel.Application
Dim objWorkBook As Workbook
Dim strPasword As String
Set objExcel = CreateObject("EXCEL.APPLICATION")
Set objWorkBook = objExcel.Workbooks.Open("C:\Intake\Excel Template\template_excel.xls", , , , "mypassword") ' Check for password
This does open the file, however, I dont wish to edit anything in VB, only use VB to open the excel sheet. After that, I need for the Excel sheet to remain open and editable manually by the user
: : I need to find code that will open up an excel file that has a password, and let a user edit it. I don't want VB to do anything except actually launch excel by means of shell or something similiar, and have the password automatically entered. Any suggestions would be appreciated.
: :
: Not sure but you may try sometjing like this
:
: Dim objExcel As Excel.Application
: Dim objWorkBook As Workbook
: Dim strPasword As String
: strPassword = InputBox("Please Enter Password", "Password")
: Set objExcel = CreateObject("EXCEL.APPLICATION")
: Set objWorkBook = objExcel.Workbooks.Open("C:\Test\test2.xls", , , , strPassword)' Check for password
: objWorkBook.SaveAs ("C:\Test\test3.xls")
: objWorkBook.Close
: Set objWorkBook = Nothing
: objExcel.Quit
: Set objExcel = Nothing
:
: