I have 10 XLS, each of which contains several hundred VBA lines that do the same. I want to move this generic code to the 11th XLS, and the remaining 10 will call the code in the 11th XLS. Shared code must have access to all data and worksheets in the calling XLS. This last requirement does not seem to be addressed by other answers to this question on SO. Can I pass XLS worksheets as a parameter or something like that?
Instead of putting it in a secondary XLS file, I would recommend creating an XLA file (Excel Add In).
, XLA. XLA , .
XLA . .
, , , .. :
Public Sub CallMe(ByVal oWorkbook as Workbook) Dim oWorksheet as Worksheet Set oWorksheet = oWorkbook.Worksheets(1) ' Do stuff... End Sub
, , , , 10 , "this", Worksheets(1) .. , oWorkbook.Workbooks(1).
Worksheets(1)
oWorkbook.Workbooks(1)
Source: https://habr.com/ru/post/1712021/More articles:How to update the maximum cycle length if the body length is shorter? - arraysДействительный XML для публикации в QuickBooks Online Edition - Получение (400) Ошибка запроса - c#When the column names in a SQL Server table are there any names that I should avoid using? - sql-serverHow can I compare two series of data in QTP - testingMailing List Management API? - apiIntegrated graphical and graphical solutions ...? - ruby-on-railsHow to check if the server supports xmpp protocol? - dnsIIS VS 2008/Web.config - неправильный формат даты - asp.netThe UML Tool Needed for C # - c #Installing Recaptcha in Joomla 1.5 user registration - phpAll Articles