VBA Progamation to Enter Worksheet Password to Update Information

Asked

Viewed 27 times

0

Great day, you guys! I have a spreadsheet matrix where pulls the information from four other spreadsheets. These four spreadsheets are password protected. I created a VBA code for when open the spreadsheet matrix it already enter the password of the worksheets to update the information but it is not working. When I open the matrix spreadsheet it does not update and the Activeworkbook line.Updatelink turns yellow. Follow the code:

Private Sub Workbook_Open()
 Application.SendKeys ("92{ENTER}")
 ActiveWorkbook.UpdateLink Name:="file:///P:Alcance\Planilha de Ponto\PLANILHA DE PONTO 2021\RAFAELA COMERCIAL.xlsx", Type:=_xlExcelLinks
 
 Application.SendKeys ("92{ENTER}")
 ActiveWorkbook.UpdateLink Name:="file:///P:Alcance\Planilha de Ponto\PLANILHA DE PONTO 2021\LUIZ FINANCEIRO.xlsx", Type:=_xlExcelLinks

Application.SendKeys ("92{ENTER}")
ActiveWorkbook.UpdateLink Name:="file:///P:Alcance\Planilha de Ponto\PLANILHA DE PONTO 2021\MARCO CONTABILIDADE.xlsx", Type:=_xlExcelLinks

Application.Sendkeys ("92{ENTER}") Activeworkbook.Updatelink Name:="file:///P:Reach Point Spreadsheet POINT SPREADSHEET 2021 RENATA FISCAL.xlsx", Type:=_xlExcelLinks

Sendkeys "{Esc}, True

End Sub

  • Have you tried running this code step by step (by pressing F8 in the code window) to see where the error is?

  • At what point does your code enter password? I don’t see any of this!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.