Avatar of Imranshakeel
 asked on

Save as VBA function for Excel

Basically my data is coming from Controller in the form of (.Xlsx) format. I want to save it after 5 mint automatically with different extension & also generate a report at user define time.

I face a problem when i save a workbook in different extension at my Drive and then i open it for check, at this moment my VBA script goes on error. How i prevent from it
Microsoft ExcelVBA

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Ryan Chong

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
[ fanpages ]

Where is the "VBA script"?

It will not be within the ".xlsx" format file initially (as a workbook with this extension does not contain any 'macro'/Visual Basic for Applications [VBA] code).

Let me see if I understand what you require from what you have provided so far...

a) A "Controller" gives you an MS-Excel (2007-2013 format) workbook file, saved with a ".xlsx" file extension.
b) You wish to (re-)save this file in an automated manner after 5 minutes (of usage/being open) with a different &, as yet, unspecified file extension.
c) At the point of saving the file in this manner you wish to generate a report; again, unspecified.
d) It sounds like the 5 minute interval is "user-defined".
e) Once saved "at my Drive", that you may mean is on your local filing system, on within a repository known as "myDrive" (or similar), if you re-open the workbook, some "VBA script" (that may, or may not, be in the workbook being opened), fails.
f) You would like to know how to prevent the "VBA script" from failing.

Please confirm if any/all/none of this is correct.

Additionally, initial queries:

1. It is unclear whether the file is constantly re-saved every 5 minutes, or just once.
2. What file extension is the file re-saved with?
3. What does the generated report look like?  Is this already written?  Does this use data within the "Controller"-provided file?
4. Where is "my Drive"?  Is that a local (C:, for example) drive, a network drive, uploaded to a web site, or somewhere else?
5. The "VBA script" is an unknown factor; how is this executed?  Can the source code be posted here for review?
6. What error messages are displayed, or what indicates the "VBA script" is not executing as intended?
Martin Liss

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.