![]() |
Program execution prob
Hi, I have a general file which will (potentially) be used by multiple users. My file imports data from different file formats & does some comparisons. In english, my code does the following; 1. "Select txt/xls file, copy contents" 2. "Select MyFile.xls, paste contents" My issue is that if the excel file is not saved as MyFile.xls, then my code _will_not_execute_. Potential users _will_ save this file under different names. How can I set it up so that while being saved under different filenames, execution of code will still be ok? Can you point me in the right direction? Appreciate any help you can offer me -- PLPE ------------------------------------------------------------------------ PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856 View this thread: http://www.excelforum.com/showthread...hreadid=383472 |
Program execution prob
Have a look at this in your VBA help:
GetSaveAsFilename Method Example This example displays the Save As dialog box, with the file filter set to text files. If the user chooses a file name, the example displays that file name in a message box. fileSaveName = Application.GetSaveAsFilename( _ fileFilter:="Text Files (*.txt), *.txt") If fileSaveName < False Then MsgBox "Save as " & fileSaveName End IfMike F"PLPE" wrote in message ... Hi, I have a general file which will (potentially) be used by multiple users. My file imports data from different file formats & does some comparisons. In english, my code does the following; 1. "Select txt/xls file, copy contents" 2. "Select MyFile.xls, paste contents" My issue is that if the excel file is not saved as MyFile.xls, then my code _will_not_execute_. Potential users _will_ save this file under different names. How can I set it up so that while being saved under different filenames, execution of code will still be ok? Can you point me in the right direction? Appreciate any help you can offer me -- PLPE ------------------------------------------------------------------------ PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856 View this thread: http://www.excelforum.com/showthread...hreadid=383472 |
Program execution prob
If i understand you question is that the user will be entering in dat which will then be sent to you right? What I did to accomplice this was to. A) Write a macro which creates a blank workbook, which then copie specific information which I have requested to be copyed and paste into the blank workbook. B) I then wrote a macro to save it to the floppy Drive (As I did no want the user to save it to other directorys etc. or under differen names) using values from cells as a name for the workbook or in you case myfile.xls C) Then a macro which just goes into the a: and sends me that file vi email. Hope that help -- funkymonkU ----------------------------------------------------------------------- funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813 View this thread: http://www.excelforum.com/showthread.php?threadid=38347 |
All times are GMT +1. The time now is 12:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com