hmmm - I have installed a ALAM file as an add-in. I developed all the code in a XLSM file - in that file format the code below works. Next I save XLSM file as a XLAM file - however now the code does not work the same - in the sense that it does not the name 'NameXLAMworkbook' - so in XLSM mode - I have 2 workbooks - one containg code - the other containing data. In XLAM mode the WorkBooks.count is only one - when in truth it should be 2.
If I hardcode my 'NameXLAMworkbook' value - see after the 2 loops -then the code works fine. However - I like to be able to identify the version of the XLAM file - I do that adding a version number to the name. guess it brings up the entire question of how do you update XLAM file - do you simply overwrite the old XLAM file with a new version having the exact same file name.
Anyway - My main problem is how to get the Workbook and corresponding sheets included in the WorkBooks.Count and the resulting Sheet.count
If I hardcode my 'NameXLAMworkbook' value - see after the 2 loops -then the code works fine. However - I like to be able to identify the version of the XLAM file - I do that adding a version number to the name. guess it brings up the entire question of how do you update XLAM file - do you simply overwrite the old XLAM file with a new version having the exact same file name.
Anyway - My main problem is how to get the Workbook and corresponding sheets included in the WorkBooks.Count and the resulting Sheet.count
Code:
'**** Finds Name of XLAM file
NameXLAMworkbook = vbNullString
For i = 1 To Workbooks.Count
For ii = 1 To Workbooks(i).Sheets.Count
If Workbooks(i).Sheets(ii).Name = "Default_Settings_01" Then NameXLAMworkbook = Workbooks(i).Name
Next ii
Next i
If NameXLAMworkbook = vbNullString Then NameXLAMworkbook = "PF_Data_Handler.xlam"