Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old December 5th, 2007, 10:07 AM
trevi trevi is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2005
Posts: 516 trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 7 h 53 m 47 sec
Reputation Power: 5
General Scripting - Advice on how to automate something

hi,

I need to automate a process for some users.
I have the first part of it figured out, which is to FTP from the mainframe to the server. Then I need to create some kind of script that takes this file, in comma delimited format and create an Excel spreadsheet from it. This will be used as input for some Word documents. My question is how do I automate it? My boss tells me that he wants to make it so all they have to do is “push a button”. Any advice would be appreciated.

Thank you.

Reply With Quote
  #2  
Old January 4th, 2008, 11:11 PM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 675 Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Days 18 h 35 m 6 sec
Reputation Power: 308
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Quote:
Originally Posted by trevi
hi,

I need to automate a process for some users.
I have the first part of it figured out, which is to FTP from the mainframe to the server. Then I need to create some kind of script that takes this file, in comma delimited format and create an Excel spreadsheet from it. This will be used as input for some Word documents. My question is how do I automate it? My boss tells me that he wants to make it so all they have to do is “push a button”. Any advice would be appreciated.

Thank you.
You can pull data into an Excel Spreadsheet pretty easily from a CSV. Do you need to automate the Word portion as well?
__________________
Click the image if at any point you don't like my decision.

Scripting problems? Windows questions? Ask the Windows Guru!


Reply With Quote
  #3  
Old January 9th, 2008, 11:11 PM
trevi trevi is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2005
Posts: 516 trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 7 h 53 m 47 sec
Reputation Power: 5
Quote:
Originally Posted by Nilpo
You can pull data into an Excel Spreadsheet pretty easily from a CSV. Do you need to automate the Word portion as well?


hi,

no, I dont need to automate the Word portion. All I need to do is get the file from the mainframe, create a spreadsheet from it and put it on the file server where it will be a source for various Word docs. I did create a console application, following advice from another person, but when I run it, I can see the Excel spreadsheet being created. Is there a way I can do this without it showing up? I will want to schedule the job in the future.

thanks

Reply With Quote
  #4  
Old January 10th, 2008, 01:47 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 675 Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Days 18 h 35 m 6 sec
Reputation Power: 308
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
With WSH, yes, because you can set the visibility of the Excel application to be hidden.

Your console app may be able to do this as well depending on how it was written.

Reply With Quote
  #5  
Old January 10th, 2008, 09:56 AM
trevi trevi is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2005
Posts: 516 trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 7 h 53 m 47 sec
Reputation Power: 5
Quote:
Originally Posted by Nilpo
With WSH, yes, because you can set the visibility of the Excel application to be hidden.

Your console app may be able to do this as well depending on how it was written.


hi. I don't know about WSH, but I can find out. I made an exe out of it and scheduled it in the scheduler. This is the part of my code where I create the file to Excel:

Code:
Sub Main()
        ' testgetfile() ' get file on server
        Dim exApp As New Excel.Application
        Dim sheet As Excel.Worksheet
        Dim c As Integer
        Dim r As Integer
        Dim conn As System.Data.Odbc.OdbcConnection
        Dim dt As New DataTable
        Dim da As System.Data.Odbc.OdbcDataAdapter
        Dim dr As DataRow
        Dim importFolder As String
        Dim fileName As String
        conn = New Odbc.OdbcConnection

        importFolder = "C:\contracts"
        fileName = "contract.txt"
        conn.ConnectionString = _
         "Driver={Microsoft Text Driver (*.txt; *.csv)};" + _
         "Dbq=C:\contracts\;" + _
        "Extensions=asc,csv,tab,txt;"


        da = New System.Data.Odbc.OdbcDataAdapter("select * from [" + fileName + "]", conn)
        da.Fill(dt)
        Dim wb As Excel.Workbook
        Dim i As Integer
        i = 0
        wb = exApp.Workbooks.Add
        'write header     
        exApp.Visible = True
        wb.Activate()
        sheet = wb.Worksheets.Add
        sheet.Name = "Contracts"
        sheet.Cells(1, 1) = "district"
        sheet.Cells(1, 2) = "first"
        sheet.Cells(1, 3) = "last"
        sheet.Cells(1, 4) = "fte"
        sheet.Cells(1, 5) = "bu"
        sheet.Cells(1, 6) = "title"
        sheet.Cells(1, 7) = "days/yr"
        sheet.Cells(1, 8) = "salsched"
        sheet.Cells(1, 9) = "currange"
        sheet.Cells(1, 10) = "step"
        sheet.Cells(1, 11) = "startdate"
        sheet.Cells(1, 12) = "%pos"
        sheet.Cells(1, 13) = "PerDiem"
        r = 2
        c = 1

        For Each dr In dt.Rows
            For c = 1 To 13
                sheet.Cells(r, c) = dr(i).ToString


                i += 1
            Next
            i = 0
            r += 1

        Next
        wb.SaveAs("conxls.xls")
    End Sub

Reply With Quote
  #6  
Old January 10th, 2008, 11:03 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 675 Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)Nilpo User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1Folding Points: 156663 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Days 18 h 35 m 6 sec
Reputation Power: 308
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Change the following line:
Code:
        exApp.Visible = True

to
Code:
        exApp.Visible = False

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > General Scripting - Advice on how to automate something


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway