Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Aug 13, 2021 9:35 pm

I want to convert my program to Spire.xls
However, I can't find linkSources() in Spire.xls

wb = ex.Workbooks.Open(trendPath);
object vntLink = (object)wb.LinkSources(); <-- I can't find
System.Array variantArray = (Array)vntLink;

for (int i = 1; i <= variantArray.Length; i++)
{
var j = variantArray.GetValue(i).ToString();
Debug.WriteLine(String.Format("j:{0}", j));

//delete yyyymmdd
var k = System.IO.Path.GetFileName(j);
var m = k.Substring(8);
Debug.WriteLine(String.Format("m:{0}", m));

foreach (var f in files)
{
Debug.WriteLine(String.Format("f:{0}", f));
if (f.ToString().EndsWith(m))
{
Debug.WriteLine(String.Format("{0}->{1}", j, f));
Console.WriteLine(String.Format("{0}->{1}", j, f));

wb.ChangeLink(j, f, Excel.XlLinkType.xlLinkTypeExcelLinks);
break;
}
}
}

kurikabocya
 
Posts: 13
Joined: Mon Aug 09, 2021 2:21 am

Mon Aug 16, 2021 10:58 am

Hello,

Thank you for your inquiry.
To help us look into your issue accurately and provide an solution, please provide your sample excel file. You could attach it here or send to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Mon Aug 16, 2021 9:23 pm

What I want to do the following procedure's Change Source... by C#
https://www.exceltip.com/links-between- ... -2007.html

kurikabocya
 
Posts: 13
Joined: Mon Aug 09, 2021 2:21 am

Tue Aug 17, 2021 10:24 am

Hello,

Thank you for your sharing.
Our Spire.XLS provides the following method to obtain and modify the external link of the excel file. But sorry to tell updating the data which links to external data is not supported by our Spire.XLS at present, if we have a plan to implement it in the future, I will inform you.
Code: Select all
            Spire.Xls.Workbook book = new Spire.Xls.Workbook();
            book.LoadFromFile(inputFile);
            //Gets a collection of external links
            ExternalLinkCollection linkCollection = book.ExternalLinks;
            foreach (ExternalLink link in linkCollection)
            {
                //Get the externally linked data source
                string source = link.DataSource;
                //Set the data source for the external link
                link.DataSource = "NewFilePath";
            }
            book.SaveToFile("result.xlsx");

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Tue Aug 17, 2021 10:35 pm

Hello
I'm using FreeSpire.XLS 10.10.0.
I can't find ExternalLinkCollection.

kurikabocya
 
Posts: 13
Joined: Mon Aug 09, 2021 2:21 am

Wed Aug 18, 2021 5:50 am

Hello,

Thank you for your feedback.
FreeSpire.XLS 10.10.0 does not contain the ExternalLinkCollection class, so we suggest you use the commercial version (Spire.XLS Pack (Hotfix) Version: 11.8.0) instead, which is more stable and has more features than the free version. To help you better evaluate our commercial version without any watermarks and restrictions, we are willing to provide you with a one-month temporary license. You can apply for a temporary license from this link: https://www.e-iceblue.com/TemLicense.html. If there is any question, please feel free to write back.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Wed Aug 18, 2021 6:50 am

Thank you, but after the "one month", we cannot use it.

kurikabocya
 
Posts: 13
Joined: Mon Aug 09, 2021 2:21 am

Wed Aug 18, 2021 11:47 am

Hello,

Sorry we don't update our free version regularly. After the temporary license expired, I suggest that you contact our sales team (sales@e-iceblue.com) to purchase a license to enjoy our commercial version.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Sun Aug 29, 2021 2:46 am

Thank you !!!!!
FreeSpire.XLS 11.8.6 worked perfect for
ExternalLinkCollection linkCollection = trendBook.ExternalLinks;

Thank you !!!!!
Thank you !!!!!
Thank you !!!!!

kurikabocya
 
Posts: 13
Joined: Mon Aug 09, 2021 2:21 am

Mon Aug 30, 2021 1:39 am

Hi,

You're welcome.
If you have other questions about using Spire.XLS in the future, please feel free to contact us.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS