How i use Excell worksheet in VB.net?

hamadsultan

New Member
Joined
Jan 23, 2011
Messages
49
Hi experts;
I have a excell worksheet which have a addins also. I want to use these sheet in Vb.net. But the problem is every time when i open the worksheet it ask to enable the macro. How i set its configration permanently that never as to enable macro and ask for the password as well when i click to enable macro? I want that before calling these sheets in VB.net i solved these problems.
I use office 2007.
Regards
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You could set the macro secrurity level to low which will automatically enable the macros.
You could also, when opening the workbook, pass the password as a parameter which should solve that section as well.
 
Upvote 0
Or to disable macros, after creating the Excel application, set its .EnableEvents property to False before you open the workbook.
 
Upvote 0
In Excel VBA it would be:-
workbook,name, Password:="xxx"
where xxx is your password.

You can use a variable for this if you're opening multiple files with different passwords.
 
Upvote 0
It might be easier to advise you if we could see the code you're using to start Excel and open the workbook. Please post this between CODE tags - the # icon in the advanced editor toolbar - and be sure to include all the relevant declarations.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,881
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top