Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
WiraYusoff
New Member

Update Basic Authentication Credentials with VBA Macro

Hi all,

 

Is there a way to update a data source's credentials (basic authentication) using a macro?

I would like to have a form where the user enters their username and password, and then pass the credentials to the data source. Rather than having the user click the Power Query ribbon -> Data Source Settings -> [Data Source] -> Edit -> Edit -> enter credentials -> Save -> Done -> Done.

 

I'm connecting to SAP HANA database and I need to pass the excel file to other users to run using their own credential once I'm done configuring the excel. 

 

Regards

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @WiraYusoff 

 

VBA is not supported in Power BI, if you need to restrict what users see you can use Row-level security, please see the link below.

https://docs.microsoft.com/en-us/power-bi/desktop-rls

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

1 REPLY 1
Mariusz
Community Champion
Community Champion

Hi @WiraYusoff 

 

VBA is not supported in Power BI, if you need to restrict what users see you can use Row-level security, please see the link below.

https://docs.microsoft.com/en-us/power-bi/desktop-rls

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.