How to call VBScript from excel macro's

rameshmsmr

New Member
Joined
Jun 4, 2011
Messages
3
HI, I need some excel vba examples, where with in the VBA code(Excel Macro) i could call a VBScript and will get some values like filename and directory information from the vbscript and assign it to the variables in VBA code.
The basic requirement here is, I need to assign dynamic values(basically file paths and filenames) to the variables in Excel macros. I dont want to go in to the macros each time i change the path, so if we can assign those values through the VBS then it would be easy assign and change the values.
Thank you in advance
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi and welcome to the board.

What VBScript do you have ? You know that you are probably able to do most VBScript operations with VBA and from VBA without the need to have a seperate VBS file.
 
Upvote 0
I need to assign dynamic values(basically file paths and filenames) to the variables in Excel macros. I dont want to go in to the macros each time i change the path, so if we can assign those values through the VBS then it would be easy assign and change the values.
 
Upvote 0
I need to assign dynamic values(basically file paths and filenames) to the variables in Excel macros. I dont want to go in to the macros each time i change the path, so if we can assign those values through the VBS then it would be easy assign and change the values.

I am afraid the code will have to be edited each time the file paths change. You could get the File paths from the users via some kind of UI such as GetOpenFilename and then assign the return values to the variables.
 
Upvote 0
In my case the users are no where responsible for specifying the input files. What i wanted is when i want to change the paths or file names, i should not go in to the excel macros and change the paths, rather its easy to change in the background VBS file if it is internally called in the Vba.
 
Upvote 0
In my case the users are no where responsible for specifying the input files. What i wanted is when i want to change the paths or file names, i should not go in to the excel macros and change the paths, rather its easy to change in the background VBS file if it is internally called in the Vba.

No. It is not easier than changing the paths in VBA plus you will still need to edit the VB script each time the paths change.
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,510
Members
452,918
Latest member
Davion615

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