Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Hello all,
What I am working on - I have a Master file that will open another workbook based on a list and the newly opened file will have a hyperlink on Cell ("C14") when you manually click the cell it Calls Macro1*. The problem I am having is in my research for this process I found this below
*Macro1 is a Addrows Macro
This won't work for me because I use a list Dimmed as a String to bring the File name and I wasn't able to make this work.
Here is my code so you can maybe see something I am not seeing.
The other alternative is to activate a hyperlink from the newly opened workbook but I think calling the Macro1 is the more direct approach. Any help is always appreciated!
Thanks in advance for all who help.
</pre>
What I am working on - I have a Master file that will open another workbook based on a list and the newly opened file will have a hyperlink on Cell ("C14") when you manually click the cell it Calls Macro1*. The problem I am having is in my research for this process I found this below
*Macro1 is a Addrows Macro
Code:
Application.Run ("'Analytics macro S17.xlsm'!getdata")
This won't work for me because I use a list Dimmed as a String to bring the File name and I wasn't able to make this work.
Here is my code so you can maybe see something I am not seeing.
Code:
'Defines file name
varCellvalue = Sheets("Main").Range("B23").Value
'Defines Type of agreement and assigns Sheet to find
varcell = Sheets("Main").Range("B19").Value
'Defines newly opened Workbook
Dim destbook As Workbook
Workbooks.Open ("\\Lax-Netapp01\Dept_private\Business Systems\LFC MACRO TEST\" & varCellvalue & ".xlsm")
Set destbook = ActiveWorkbook
'Here is where I would enter something like
Application.Run (destbook & "!Macro1")
The other alternative is to activate a hyperlink from the newly opened workbook but I think calling the Macro1 is the more direct approach. Any help is always appreciated!
Thanks in advance for all who help.
</pre>