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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.