# Cell.GetBarcodeAsync Method

> Cell.GetBarcodeAsync method in the TX Sheet Control .NET API: Reads detached settings, or null when the cell has no barcode.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > Cell > Cell.GetBarcodeAsync Method
- **675 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/cell/getbarcodeasync-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/cell/getbarcodeasync-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/cell/getbarcodeasync-method/llms-full.txt

---

Reads detached settings, or null when the cell has no barcode.

### Syntax

```csharp
public Task<BarcodeOptions?> GetBarcodeAsync(CancellationToken cancellationToken = default)
```

### Remarks

See [Barcodes and QR Codes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/barcodes/llms-full.txt) for a complete .NET example, source validation, mail merge and file compatibility.

### Examples

Create and save a label workbook with the configured barcode settings.

```csharp
using TXTextControl.TXSheetControl.Server;

static async Task<byte[]> CreateLabelsAsync(ServerSheetControl control)
{
    var sheet = await control.Workbook.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("https://example.com/invoice/1042");
    var options = new BarcodeOptions {
        Symbology = "qrCode", Source = "A1", ShowText = false,
        Foreground = "#163b63", Background = "#ffffff", ErrorCorrection = "M", Version = 3
    };
    await sheet.Cell("B2").SetBarcodeAsync(options);
    await sheet.Cell("D2").SetBarcodeAsync(new BarcodeOptions { Symbology = "code128", Value = "001042", ShowText = true });
    var snapshot = await sheet.Cell("B2").GetBarcodeAsync();
    return await control.SaveAsync(StreamType.SpreadsheetML);
}
```

---

## Nearby

- **Previous:** [Cell.SetValueAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/cell/setvalueasync-method/llms-full.txt)
- **Next:** [Cell.SetBarcodeAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/cell/setbarcodeasync-method/llms-full.txt)
