Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

macro in excel to get a file

Posted on 2004-10-07
12
Medium Priority
?
367 Views
Last Modified: 2012-05-05
I dont know how to implement this. I am exporting a crystal report to excel sheet and shall save it to a destination folder called CRexcel. Everytime I run the report,I am going to save it in this same folder. But I want to get that file (excel file) and have to do some sorting and some formatting.
What needs to be done to go get that file and implement some formatting and sorting on that file.

I would really appreciate a quick response.


thanks in advance!

0
Comment
Question by:asnath
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 total points
ID: 12252294
I don't think this can be done from Crystal.  It could be done from a front-end application.

mlmcc
0
 
LVL 42

Assisted Solution

by:frodoman
frodoman earned 1000 total points
ID: 12252434
I agree, this cannot be done from Crystal.  Once you finish the export Crystal cannot interact w/ that Excel file any longer - it's a one way feed.

There are lots of applications that can read from Excel and manipulate it from there.  You could, for example, create a filesystemwatcher option in vb.net and have it fire off a small application whenever a new Excel file hits this folder.  Most application languages that I know of have similar functionality and you may want to do some searching in the forum for whichever language(s) you prefer.

frodoman
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12252569
You can create anet application. Open the excel and format it as you wish
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 

Author Comment

by:asnath
ID: 12254352
hi ebolek

Can u help me with the code for the net application or in the VBA editor.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12255362
Here is a way to get the basic code required.

Open the spreadsheet
Start recording a macro
Click TOOLS --> MACROS --> RECORD NEW MACRO
Give it a name - Doesn't really matter but remember it
Go through the steps you desire for the macro
Stop the recording (STOP Button on the macro recording popup)

Open the macro for editting
Click TOOLS --> MACRO --> MACROS
Select the macro and click EDIT

The code you see is the basic code you need from VB or VBA

mlmcc
0
 

Author Comment

by:asnath
ID: 12256035
hi mlmcc
thanks for the response. I would like to know one more thing.I am going to use the same macro for all the excel files.So how do i run the same macro for the other excel file.

Thanks a lot !

 
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12257579
You can edit the macro code and then copy & paste it into other worksheets.

There is a way to use external macros as well so you could create on worksheet that contains the macro and then in each new Excel file you could reference and run the macro from the "master" worksheet.  You'd probably need to seek details in the Excel forum but also this is likely more trouble then simply copy & pasting.

frodoman
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12454737
Solved the basic problem  frodoman probably solved the followon question

mlmcc
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12462765
Agreed
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question