Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Sometimes, the workbook contains external links which are hidden and cannot be viewed in Microsoft Excel. Aspose.Cells retrieves all the external links whether they are visible or hidden. However, you can check the ExternalLink.IsVisible property to check if the external link is visible or not.
The following sample code loads the source excel file which contains hidden external links. These links cannot be viewed in Microsoft Excel but they are present inside the workbook. After printing ExternalLink.GetDataSource() and ExternalLink.IsReferred property, it prints the ExternalLink.IsVisible property. In the console output below, you see, all of its external links are not visible.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Loads the workbook which contains hidden external links
Workbook workbook(srcDir + u"sample.xlsx");
// Access the external link collection of the workbook
ExternalLinkCollection links = workbook.GetWorksheets().GetExternalLinks();
// Print all the external links and check their IsVisible property
for (int i = 0; i < links.GetCount(); i++)
{
ExternalLink link = links.Get(i);
std::cout << "Data Source: " << link.GetDataSource().ToUtf8() << std::endl;
std::cout << "Is Visible: " << (link.IsVisible() ? "true" : "false") << std::endl;
std::cout << std::endl;
}
Aspose::Cells::Cleanup();
}
Here is the console output of the above sample code when executed with the given sample excel file.
Data Source: C:\International\DDB\FAS 133\Swap Rates\GS_1M_3M_1_2_5_¥$_(B)IRSwaps_0400.xls
Is Referred: True
Is Visible: False
Data Source: C:\DIST DAY\MAY TEMPLATES\030601t.xls
Is Referred: True
Is Visible: False
Data Source: C:\AREVIEW\2002 Controllable\Autobrct.xls
Is Referred: True
Is Visible: False
Data Source: C:\CARDSFO\Main Files\Rate Forecast\FY 11\IFR 11 01 (New Model REPORTS 11.08.07).xls
Is Referred: True
Is Visible: FalseAnalyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.