【问题标题】:Update a spreadsheet by sheet name按工作表名称更新电子表格
【发布时间】:2014-05-02 12:10:15
【问题描述】:

我需要使用 google-doc-api 来更新我的网站详细信息。在谷歌开发者论坛和文档中,他们只指定使用提要条目 id 更新工作表值

例如:WorksheetEntry worksheet = (WorksheetEntry)wsFeed.Entries[0];

在上面的代码中,我们可以编辑第一张表。但我的情况不同。我只有 Sheet1、Sheet2 等工作表名称。那么我如何找到工作表并将我的值添加到我指定的工作表中。

【问题讨论】:

    标签: c# google-sheets google-docs google-docs-api google-spreadsheet-api


    【解决方案1】:

    获取工作表名称:

      foreach (WorksheetEntry entry in wsFeed.Entries)
      {
        // Get the worksheet's title, row count, and column count.
        string title = entry.Title.Text;
        int rowCount = entry.Rows;
        int colCount = entry.Cols;
    
        // Print the fetched information to the screen for this worksheet.
        Console.WriteLine(title + "- rows:" + rowCount + " cols: " + colCount);
      }
    

    来自: https://developers.google.com/google-apps/spreadsheets/#retrieving_information_about_worksheets

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-14
      • 2012-12-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多