Do not use on any
shared computer
August 29, 2008 09:10pm pdt
 
[x]
Attachment Details

Need to make a scrip to open and save excel documents

Zone: VB Script
I am currently in need of a script that will open an excel file from a specified document, then push enter to update the spreadsheet, and then save and close the sheet.  There are quite a few spreadsheets so I only used 9 or 10 for this example.  I believe there are 91 actually.  I put together some pseudo code to make it easier to visualize what I am needing.  If anyone can help me with this, I would appreciate it.  I have no vb experience and only use PHP and SQL so I was not sure of what format is used.  Here is the pseudo code:(this should show everything I need)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
**paths and filenames**
path = O:\Budget 2008 2009\MA budget Calculations
folder1 = MA budget calculation 1st quarter 2008
folder2 = MA budget calculation 2nd quarter 2008
folder3 = MA budget calculation 3nd quarter 2008
folder4 = MA budget calculation 4nd quarter 2008
folders = array(folder1, folder2, folder3, folder4)
file_set1 = array(#2/xls, #4.xls, #5.xls, #6.xls)
file_set2 = array(bakery, deli, meat, floral, photo)
**beginning of loop to open files and update**
z = 0
while(z < 4){
  folder = one element popped from folders
  y = 0
  while(y < 4){
    file = one element popped from file_set1
    open path/folder/file
    **selects yes to update file and then saves and closes the file**
    sendkeys {enter}
    sendkeys %
    sendkeys f
    sendkeys s
    sendkeys %
    sendkeys f
    sendkeys c
    y++
  }
  y = 0
  while(y < 5){
    file = one element popped from file_set2
    **dept was used because these files are in another folder**
    open path/folder/dept/file
    **selects yes to update file and then saves and closes the file**
    sendkeys {enter}
    sendkeys %
    sendkeys f
    sendkeys s
    sendkeys %
    sendkeys f
    sendkeys c
    y++
  }
  z++
}
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: grizzly_adams
Solution Provided By: RobSampson
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Accepted Solution by RobSampson

Rank: Genius

Accepted Solution by RobSampson:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by grizzly_adams
Author Comment by grizzly_adams:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RobSampson

Rank: Genius

Expert Comment by RobSampson:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by grizzly_adams
Author Comment by grizzly_adams:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RobSampson

Rank: Genius

Expert Comment by RobSampson:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by grizzly_adams
Author Comment by grizzly_adams:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RobSampson

Rank: Genius

Expert Comment by RobSampson:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628