I have a csv files containing iterations that will be imported into HP Quality Center and used to perform automated testing.
Some of the data in these files must be updated every month and I have created a macro for each to do this.
I cannot keep the macro and the csv on the one workbook as QC does not allow anything other than csv files to be imported (not that I know of).
I realise I can import the macro each time but there are many csv files and many macros.
Is there some format or work-around that would allow me to keep the macro on the csv file, so when I open it I can just hit Alt+F8 and run the macro?
Save your macros in your personal workbook (personal.xslb), rather than in the individual data files. Then they will be available to run your updates on the csv files without being stored in the files.
Related
so I have about 90 different excel files that are customer reports. I have one generic excel file that's a summary page that I need to insert as a sheet into all of those other excel files. Does anyone have a way to automate this process - I'm generating the sheets through alteryx but open to solutions outside of that platform or maybe there's a simple way to do it through Excel that I'm missing.
Right now, the only option is to open each report and copy over the summary sheet and insert it that way. To do it for 90 sheets would take me over an hour so trying to shorten the time.
I use VBA in Excel to pull data from different sources (mostly .csv and .xls/.xlsx files) and paste them into my data tables (in the same Excel File I have a data table for each specific data source).
Each of those files comes with different settings. I have created an specific VBA Macro for each of my data sources to process, remove and copy the relevant information of each individual file, and then I call all of the Macros from another Macro. The problem I'm having is that for one of the data sources, when using the Workbooks.Open method, I have had to set the parameter Format to "Nothing" (Format:=5). But this affects then the subsequent macros and therefore the following files are not processed correctly.
I know I have two possibilities: Either I call this macro at the end, after I've processed all the other files or; I set the Format parameter in all of my Macros to the one specific for each of the files configuration. However there must be a way to simply reset the delimiter to the default one used in my Regional Settings. Does anyone knows a solution?
Sorry if there's already a thread with this issue but I've tried looking for it and didn't find any.
Thank you in advance.
How can you export an excel file to a .CSV file with all of the filters present on the .xlsx file applied?
I have ~1000 rows of data in an .xlsx file, but only require rows with certain criteria to be exported to the .csv file. When exporting with the filters on the row, obviously all of the data is just exported to the .csv file, not just the visible data present after the filter. I require just the filtered data, as the report is handling live data which changes, and my program can only import .csv files due to internal policies.
Sorry this isn't quite a programming question; however the answer will be used to implement this into a programmed solution, which I am hoping to provide on this thread after it has been completed.
I am trying to develop a manner in VBA to track changes in a document without having to hide the contents in an extra sheet within a workbook.
I understand that if you change the extension of an Excel file to ".zip", you can access the Excel document as components sorted into directories. Is there a way to save and write to a text file within one of these directories so that I can access it every time the document is opened, without having to have the user drag a log file along with the Excel document?
Some facts:
When Excel opens the file, the file is blocked by Excel. There is no possibility to write to that file within VBA
You can store additional data into that file externally or after the Excel workbook has been closed
You would need to have code externally from the workbook to accomplish writing to that file after it has been closed. You may want to use VSTO or an oldschool Excel Addin.
you have to ensure that Excel will not destroy your changes when restructuring or repairing the file.
In the first run, your idea sounds very natural, to not use sheets from a programmer's point of view. You only have full control on Excel files when
you use external libraries (e.g. Spreadsheet Gear) or
you remote control Excel via automation.
you use openxml SDK for Excel
you use VBA
You could insert additonal information and take care that this information is not skipped by Excel.
When you want to do the tracking this way, I would suggest you to use an Excel Addin. There is actually no need for installation when using this kind of Addin. Attach to open workbook and close workbook events and ensure that all changes are written to the Excel Workbook after it has been closed. Certainly you would have to attach to all kind of other events to track all changes to the workbook. You may need to have in mind that there can be more than one workbook opened at a time.
Actually there are alternatives.
write your logging code in VBA or whatever fits
abstract away how your persist the code (e.g. use a data provider)
think about these two alternatives to store logging data:
You can save logging data in cells of excel. When using a "newer" version of excel, you have a limit of 1 million rows. You may want to implement a rolling mechanism that ensures that you never go over the border of 1 million records. (you may be dont want to track a million changes)
You can use the document properties to store you information as xml.
Last but not least, the most obvious: Why not using Excel's functionality of tracking changes? Understand track changes in Excel 2013
I'm trying to automate an ETL process in which a flat file (.xlsx) is placed into a folder and then a macro I built performs all the necessary transformations to the file. Right now I have to open the original .xlsx file then manually insert/run the macro (the macro saves and closes the file automatically). From here I have a program that automatically loads the transformed file into my db.
I was wondering what I could do to automate the inserting and running the macro step?
You need to save your workbook as an xlsm or xlsb file, as xlsx workbooks can't contain any vba code. After that, you can run your macro, either manually, or from a worksheet button.