ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   querytables.add..Invalid argument for URL connection type (https://www.excelbanter.com/excel-programming/430806-querytables-add-invalid-argument-url-connection-type.html)

jranan

querytables.add..Invalid argument for URL connection type
 

I am trying to dynamically create a web query in an excel workbook project
and am getting an error whenever I try to use a connection of type URL;

Microsoft.Office.Interop.Excel.Range range = worksheet.get_Range("A1", "A1");
Microsoft.Office.Interop.Excel.QueryTable qTable =
worksheet.QueryTables.Add(@"URL;http://localhost/SampleReport", range, null);
qTable.Name = "Test Report";

I am used C# code and this works fine from a embedded VBA module. Why not
from a .NET managed excel workbook?

Any ideas?

jranan

querytables.add..Invalid argument for URL connection type
 

ps. I am getting an ArgumentException with a description of "The parameter is
incorrect"



All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com