c# - How do I create an executable application for a Excel macro procedure? -
I have two spreadsheets ("old" and "new") and a VB script macro. The macro runs in one ("new"), compares the contents of the second ("old"), and then brings the results back to the "new" spreadsheet.
I want to make an executable, where I input two file names and click on a run button to simplify the process. Opening both the files in the current process, then cutting and pasting the script into the "new" VB editor requires it and running it there. I'm looking for advice as to what programming language or tool I can use to create this application in Windows XP to run against a spreadsheet that can be created in Excel 2007.
Can I use C # to write a simple application that can do this?
You could talk to me about resources for writing C # applications to interact with Excel that would be greatly appreciated.
This is my first such application which is an attempt to write the exchange of information. Maybe this is not possible. If there is such a thing, please tell me so much.
Why not just create an Excel file whose name is" Compare.Xls "that run user files To allow for the following code will be used and compare them on
FileDialog defines the sOldFile string slow sNewFile as string fd as set in fd = application .FileDialog (msoFileDialogOpen) fd.AllowMultiSelect = False MsgBox "Please select old file" fd.Show Workbooks.Open fd.SelectedItems (1) sOldFile = ActiveWorkbook.Name MsgBox fd.Show Workbooks.Open fd "Please select new file" can use some other error checking to select it, such as whether the user does not cancel or press escape to file dialog, but it should be . You create a button on 1 file and allow two users to run comparisons of that file on selected files. Edit:. If I still have thought about this, then you can add a call to your macro in thisWorkbook under Workbook_Open and it is automatically running whenever anyone can open.xls.
Comments
Post a Comment