Power query ��� excel mac os

Import data in Excel for Mac (Power Query)

Excel for the Mac incorporates Power Query (also called Get & Transform) technology to provide greater capability when importing, refreshing, and authenticating data sources, managing Power Query data sources, clearing credentials, and changing the location of file-based data sources. You can also create a Power Query query by using VBA.

Note: Watch for further announcements about improvements to Excel for Mac and Power Query integration.

For more information about using legacy connectors to import data, see Import data in Excel for the Mac (Legacy).

Select Data > Get Data.

In the Choose data source – Get Data (Power Query) dialog box, select Excel workbook or Text/CSV.

Select Browse to locate the file you want to connect as the data source.

In the File picker dialog box, select the file, review the file details, and then click Next.

If there is more than one set of data, on the left, select the data you want to import, and then on the right, confirm the selection in data preview.

At the bottom right, select Load.

The imported data appears in a new sheet.

You can refresh the following data sources: SharePoint files, SharePoint lists, SharePoint folders, OData, text/CSV files, Excel workbooks (.xlsx), XML and JSON files, local tables and ranges, and a Microsoft SQL Server database.

Refresh the first time

The first time you try to refresh file-based data sources in your workbook queries, you may need to update the file path.

Select Data, the arrow next to Get Data, and then Data Source Settings. The Data source settings dialog box appears.

Select a connection, and then select Change File Path.

In the File path dialog box, select a new location, and then select Get Data.

Refresh subsequent times

All data sources in the workbook, select Data > Refresh All.

A specific data source, right click a query table on a sheet, and then select Refresh.

A PivotTable, select a cell in the PivotTable, and then select PivotTable Analyze > Refresh Data.

The first time you access SharePoint, SQL Server, OData or other data sources that require permission, you must provide appropriate credentials. You may also want to clear the credentials to enter new ones.

When you refresh a query for the first time, you may be asked to login. Select the authentication method and specify the login credentials to connect to the data source and continue with the refresh.

If login is required, the Enter credentials dialog box appears.

SQL Server credentials:

Select Data > Get Data > Data Source Settings.

In the Data Source Settings dialog box, select the connection you want.

At the bottom, select Clear Permissio ns.

Confirm this is what you want to do, and then select Delete.

Although authoring in the Power Query Editor is not available in Excel for Mac, VBA does support Power Query authoring. Transferring a VBA code module in a file from Excel for Windows to Excel for Mac is a two-step process. A sample program is provided for you at the end of this section.

Читайте также:  Flushdns mac os catalina

Step one: Excel for Windows

On Excel Windows, develop queries by using VBA. VBA code that uses the following entities in the Excel’s object model also work in Excel for Mac: Queries object, WorkbookQuery object, Workbook.Queries Property. For more information, see Excel VBA reference.

In Excel, make sure the Visual Basic Editor is open by pressing ALT+F11.

Right-click the module, and then select Export File. The Export dialog box appears.

Enter a filename, make sure the file extension is .bas, and then select Save.

Upload the VBA file to an online service to make the file accessible from the Mac.

You can use Microsoft OneDrive. For more information, see Sync files with OneDrive on Mac OS X.

Step two: Excel for Mac

Download the VBA file to a local file, the VBA file you saved in «Step one: Excel for Windows» and uploaded to an online service.

In Excel for Mac, select Tools > Macro > Visual Basic Editor. The Visual Basic Editor window appears.

Right-click on an object in the Project window, and then select Import File. The Import File dialog box appears.

Locate the VBA file, and then select Open.

Here is some basic code you can adapt and use. This is a sample query that creates a list with values from 1 to 100.

Источник

Import data in Excel for Mac (Power Query)

Excel for the Mac incorporates Power Query (also called Get & Transform) technology to provide greater capability when importing, refreshing, and authenticating data sources, managing Power Query data sources, clearing credentials, and changing the location of file-based data sources. You can also create a Power Query query by using VBA.

Note: Watch for further announcements about improvements to Excel for Mac and Power Query integration.

For more information about using legacy connectors to import data, see Import data in Excel for the Mac (Legacy).

Select Data > Get Data.

In the Choose data source – Get Data (Power Query) dialog box, select Excel workbook or Text/CSV.

Select Browse to locate the file you want to connect as the data source.

In the File picker dialog box, select the file, review the file details, and then click Next.

If there is more than one set of data, on the left, select the data you want to import, and then on the right, confirm the selection in data preview.

At the bottom right, select Load.

The imported data appears in a new sheet.

You can refresh the following data sources: SharePoint files, SharePoint lists, SharePoint folders, OData, text/CSV files, Excel workbooks (.xlsx), XML and JSON files, local tables and ranges, and a Microsoft SQL Server database.

Refresh the first time

The first time you try to refresh file-based data sources in your workbook queries, you may need to update the file path.

Select Data, the arrow next to Get Data, and then Data Source Settings. The Data source settings dialog box appears.

Select a connection, and then select Change File Path.

In the File path dialog box, select a new location, and then select Get Data.

Refresh subsequent times

All data sources in the workbook, select Data > Refresh All.

A specific data source, right click a query table on a sheet, and then select Refresh.

Читайте также:  Windows browser mac os

A PivotTable, select a cell in the PivotTable, and then select PivotTable Analyze > Refresh Data.

The first time you access SharePoint, SQL Server, OData or other data sources that require permission, you must provide appropriate credentials. You may also want to clear the credentials to enter new ones.

When you refresh a query for the first time, you may be asked to login. Select the authentication method and specify the login credentials to connect to the data source and continue with the refresh.

If login is required, the Enter credentials dialog box appears.

SQL Server credentials:

Select Data > Get Data > Data Source Settings.

In the Data Source Settings dialog box, select the connection you want.

At the bottom, select Clear Permissio ns.

Confirm this is what you want to do, and then select Delete.

Although authoring in the Power Query Editor is not available in Excel for Mac, VBA does support Power Query authoring. Transferring a VBA code module in a file from Excel for Windows to Excel for Mac is a two-step process. A sample program is provided for you at the end of this section.

Step one: Excel for Windows

On Excel Windows, develop queries by using VBA. VBA code that uses the following entities in the Excel’s object model also work in Excel for Mac: Queries object, WorkbookQuery object, Workbook.Queries Property. For more information, see Excel VBA reference.

In Excel, make sure the Visual Basic Editor is open by pressing ALT+F11.

Right-click the module, and then select Export File. The Export dialog box appears.

Enter a filename, make sure the file extension is .bas, and then select Save.

Upload the VBA file to an online service to make the file accessible from the Mac.

You can use Microsoft OneDrive. For more information, see Sync files with OneDrive on Mac OS X.

Step two: Excel for Mac

Download the VBA file to a local file, the VBA file you saved in «Step one: Excel for Windows» and uploaded to an online service.

In Excel for Mac, select Tools > Macro > Visual Basic Editor. The Visual Basic Editor window appears.

Right-click on an object in the Project window, and then select Import File. The Import File dialog box appears.

Locate the VBA file, and then select Open.

Here is some basic code you can adapt and use. This is a sample query that creates a list with values from 1 to 100.

Источник

Импорт данных в Excel для Mac (Power Query)

Excel для Mac включает в себя технологию Power Query (также называемую функцией » Get & Transform»), которая обеспечивает больше возможностей при импорте, обновление и проверке подлинности источников данных, управлении источниками данных Power Query, очистке учетных данных и изменении расположения файлового источника данных. Вы также можете создать запрос Power Query с помощью VBA.

Примечание: Следите за дальнейшими объявлениями об улучшениях интеграции Excel для Mac Power Query.

Дополнительные сведения об импорте данных с помощью устаревших соединитекторов см. в Excel для Mac (устаревшие).

Выберите Данные> Получить данные.

В диалоговом окне Выбор источника данных — Получить данные (Power Query) выберите Excel или Текст/CSV.

Чтобы найти файл, который вы хотите подключить в качестве источника данных, выберите обзор.

Читайте также:  Ошибка 2002f mac os решение

В диалоговом окне Выбор файла выберите файл, просмотрите сведения о файле и нажмите кнопку Далее.

Если имеется несколько наборов данных, в левой части выберите данные, которые вы хотите импортировать, а затем справа подтвердит выбор в режиме предварительного просмотра данных.

В правой нижней части выберите загрузить.

Импортируемые данные по появится на новом листе.

Вы можете обновить следующие источники данных: файлы SharePoint, списки SharePoint, папки SharePoint, OData, текстовые/CSV-файлы, книги Excel (.xlsx), файлы XML и JSON, локальные таблицы и диапазоны, а также базу данных Microsoft SQL Server.

Обновление в первый раз

При первой попытке обновить источники данных на основе файлов в запросах к книге может потребоваться обновить путь к файлу.

Выберите Данные, стрелку рядом с рядом с получить данные,а затем источникданных Параметры . Появится диалоговое окно Параметры источника данных.

Выберите подключение, а затем выберите Изменить путь к файлу.

В диалоговом окне Путь к файлу выберите новое расположение и выберите получить данные.

Обновление последующих обновлений

Все источники данных в книге, выберите Данные > Обновить все.

В определенном источнике данных щелкните правой кнопкой мыши таблицу запроса на листе и выберите обновить.

В этой области вы можете выбрать ячейку в ее ячейке, а затем нажать анализ > обновить данные.

При первом доступе к SharePoint, SQL Server, OData или другим источникам данных, которые требуют разрешения, необходимо предоставить соответствующие учетные данные. Кроме того, может потребоваться очистить учетные данные, чтобы ввести новые.

Ввод учетных данных

При первом обновлении запроса может потребоваться войти в систему. Выберите способ проверки подлинности и укажите учетные данные для подключения к источнику данных и продолжения обновления.

Если вход необходим, появится диалоговое окно Введите учетные данные.

SharePoint учетные данные:

SQL Server учетные данные:

Очистка учетных данных

Выберите данные> Получить данные > источник данных Параметры.

В диалоговом окнеПараметры источника данных выберите нужное подключение.

В нижней части выберите очистить permissio ns.

Подтвердите это и выберите удалить.

Хотя редактор Power Query не поддерживается в Excel для Mac, VBA поддерживает их. Перенос модуля кода VBA из Excel для Windows в Excel для Mac процесс идет в два шага. В конце этого раздела вам будет предоставлен пример программы.

Шаг 1. Excel для Windows

На Excel Windows разработайте запросы с помощью VBA. Код VBA, использующий следующие объекты в объектной модели Excel также работает в объекте Excel для Mac: Запросы, Объект WorkbookQuery, Свойство Workbook.Queries.Дополнительные сведения см. в Excel VBA.

В Excel откройте редактор Visual Basic, нажав ALT+F11.

Щелкните модуль правой кнопкой мыши и выберите экспортировать файл. Появится диалоговое окно Экспорт.

Введите имя файла, убедитесь, что его расширение — .bas, а затем выберите Сохранить.

Upload VBA в веб-службу, чтобы сделать его доступным с Mac.

Вы можете использовать Microsoft OneDrive. Дополнительные сведения см. в этой OneDrive mac OS X.

Шаг 2. Excel для Mac

Скачайте VBA-файл в локальный файл, VBA-файл, сохраненный на этапе «Шаг 1: Excel для Windows» и загруженный в веб-службу.

В Excel для Mac выберите Инструменты> Макрос> Visual Basic редактора. Появится Visual Basic редактора.

Щелкните правой кнопкой мыши объект в окне Project и выберите импортировать файл. Появится диалоговое окно Импорт файла.

Найдите файл VBA и выберите открыть.

Вот некоторые базовые коды, которые можно адаптировать и использовать. Это пример запроса, который создает список со значениями от 1 до 100.

Источник

Оцените статью