Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I want to create code using the sendkeys( I know they are not very realiable but this is all I can do) to remove the project protection off a certain project however I am not sure how to select the project via sendkeys. We have multiple hiden sheets which are avilable in VBA but I need to select one called First. Any idea how to do this. Thanks Noemi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Noemi,
Try something Set Application.VBE.ActiveVBProject = Workbooks("Book1.xls").VBProject This will select the Book1.xls project in the VBE. You can't make a components active if the project is locked. Once you've unlocked the project, you can make a component active with Set Application.VBE.ActiveCodePane = _ Workbooks("Book4.xls").VBProject.VBComponents("Fir st").CodeModule.CodePane -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "Noemi" wrote in message ... Hi I want to create code using the sendkeys( I know they are not very realiable but this is all I can do) to remove the project protection off a certain project however I am not sure how to select the project via sendkeys. We have multiple hiden sheets which are avilable in VBA but I need to select one called First. Any idea how to do this. Thanks Noemi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I should have added that in the second line of code "first" refers to the
CodeName of the worksheet, not the name of the worksheet as shown in the tabs. If you need to use the tab name, use code like With Workbooks("Book4.xls").Worksheets("TabName") Set Application.VBE.ActiveCodePane = _ .Parent.VBProject.VBComponents(.CodeName).CodeModu le.CodePane End With -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "Chip Pearson" wrote in message ... Noemi, Try something Set Application.VBE.ActiveVBProject = Workbooks("Book1.xls").VBProject This will select the Book1.xls project in the VBE. You can't make a components active if the project is locked. Once you've unlocked the project, you can make a component active with Set Application.VBE.ActiveCodePane = _ Workbooks("Book4.xls").VBProject.VBComponents("Fir st").CodeModule.CodePane -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "Noemi" wrote in message ... Hi I want to create code using the sendkeys( I know they are not very realiable but this is all I can do) to remove the project protection off a certain project however I am not sure how to select the project via sendkeys. We have multiple hiden sheets which are avilable in VBA but I need to select one called First. Any idea how to do this. Thanks Noemi |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chip
Thank you so much, it worked. Thanks Noemi "Chip Pearson" wrote: I should have added that in the second line of code "first" refers to the CodeName of the worksheet, not the name of the worksheet as shown in the tabs. If you need to use the tab name, use code like With Workbooks("Book4.xls").Worksheets("TabName") Set Application.VBE.ActiveCodePane = _ .Parent.VBProject.VBComponents(.CodeName).CodeModu le.CodePane End With -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "Chip Pearson" wrote in message ... Noemi, Try something Set Application.VBE.ActiveVBProject = Workbooks("Book1.xls").VBProject This will select the Book1.xls project in the VBE. You can't make a components active if the project is locked. Once you've unlocked the project, you can make a component active with Set Application.VBE.ActiveCodePane = _ Workbooks("Book4.xls").VBProject.VBComponents("Fir st").CodeModule.CodePane -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "Noemi" wrote in message ... Hi I want to create code using the sendkeys( I know they are not very realiable but this is all I can do) to remove the project protection off a certain project however I am not sure how to select the project via sendkeys. We have multiple hiden sheets which are avilable in VBA but I need to select one called First. Any idea how to do this. Thanks Noemi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select cells that sum up to a specific value | Excel Discussion (Misc queries) | |||
select specific records | Excel Programming | |||
select records with a specific value | Excel Worksheet Functions | |||
Select specific cell | Excel Discussion (Misc queries) | |||
Problem with invoking project specific Sub in Excel???? | Excel Programming |