Sharepoint "Export to Spreadsheet" Question - vba

I have just begun programming in VBA and despite my researching efforts have a quick question for the community...
Is it possible to perform the sharepoint action "Export to Spreadsheet" using a VBA macro?
I want to export to excel and create a few pivot tables if you are wondering where I am going with this.
A push in the right direction would be extremely helpful... I wish I had some code to post but I am still in the planning/researching stage.

I would first like to thank #Tim Williams for directing me towards the support.microsoft.com/kb/930006 link as I believe I have found a solution to my question. (If I had enough reputation your comments would be upvoted!)
I was able to generate an .iqy file from the "Export to Spreadsheet" command which I have successfully transferred into a VBA web query. Alternatively, I was able to simply save the .iqy file and open it with the VBA code. Both have successfully populated my spreadsheet so I can now do the reporting I was looking to do.

Related

Is there a tool which visualizes VBA code via e.g. a flow chart?

If possible, also run through all modules in an excel application.
Flowchart would be something useful. I have never seen something similar for code, but there are a few VBA tools, that you may find interesting. These are the ones that I know: http://www.vitoshacademy.com/vba-professional-tools-for-vba
In general, concerning code, MZ-Tools has a good option to show the statistics of the used code. This is how it looks like:
Then you can save it as a *.txt file, edit it a bit and load it into Excel. From there you can make your own charts easily, if you need it.

Sharing VBA code stored in PERSONAL.XLSB

I have written some VBA for Excel which I'm sharing with colleagues by manually exporting the .BAS files from which they manually import.
Having just discovered I can use VBA to automate this process myself - see here at Ron de Bruin & and here at Chip Pearson - so it seems to me I can set up my colleagues machines to check for any changes when Excel opens and update the modules in their PERSONAL.XLSB file.
QUESTION: My questions is whether there are any pitfalls in doing this that I might not be aware? (Aside from the obviously need to keep the code-hub secure)
I've completed most of the development now (after 75 increments) and changes are only about once a month so the overhead of updates are bearable. However it may be possible to distribute code in a similar way.
BTW: I search the Stack Overflow for similar questions, the closest I got was - Replacement of old modules with updated ones in PERSONAL.XLSB
Thanks.

Excel Personal Worksheet VBA Module's won't allow me to view code

My personal workbook (PERSONAL.xlsm) has stopped allowing me to view the code or any details of the modules I have saved there. It also will not allow me to run any of the Macros it once included. I don't know if they got deleted or are hiding somewhere (but I am hoping it is the later). I have not done anything out of the ordinary. Before this issue was happening all I had done with excel today was run one of these macros (without issue), make an edit to include the solver in a macro, and save it.
In addition to this problem there are a few others that seem to accompany it:
Occasionally when I close excel without saving a file, excel crashes.
If I attempt to record a macro (either in the Personal Workbook or to
another location) one of the following happens:
a. Excel crashes.
b. Excel gives me an Invalid Name Error (despite the name being perfectly valid.
It is worth noting that macros not saved in the Personal Workbook work just fine. I am very stumped and cannot find a solution to this problem anywhere. I have tried the obvious (rebooting my computer), the not so obvious (restoring previous versions of files), and the weird (disabling and enabling random things in the excel options section). Please, if you have a solution let me know!
Thank you in advance, all and any suggestions are appreciated!
I had a similar problem a while ago. I had to:
close Excel
re-name PERSONAL.xlsm to something else (like temp.xlsm)
open Excel and verify it does not "see" or attempt to open PERSONAL
create a new PERSONAL.xlsm
copy all VBA from temp.xlsm to the new PERSONAL.xlsm
Can't comment yet, so i apologize in advance.
It is definitely Excel at fault, it happens to me so often (on big files including VBA) that my before_save saves a copy of the file with time in its name, and all module's, userform's, sheet's code as *.frm, *.cls, *.bas.
I usually can also open corrupt files by holding SHIFT key (force designer mode) and then copy manually stuff.

saving any file with VBA code

Is it possible to save any file with VBA code?
Speciffically I a trying to save an already existing PDF file to a different lacation. The macro is run within excel workbook.
I have been browsing net for the answer, yet resultlessly, maybe I am asking wrong questions.
I would appreciate any help, pointing to tge right "key words" would be much appreciated as well.
There should be so many options for you FileCopy, Move, Name etc. are a few.
However, Ron De Bruin, has a great article on this, http://www.rondebruin.nl/win/s3/win026.htm

Executing a macro in Excel sheet

I would like to execute a macro (VBA Code for formatting the sheet) in an excel sheet that i create from code. The approach I use right now is put the macro in the workbook_open
event and open the Excel sheet from code. That applies the formatting and I save it later. But this slows down the process a lot.
I would like to know if there is way I can execute a macro using the DocumentFormat.OpenXml SDK or some other .net class without actually opening the excel file thus improving performance.
I have gone through a lot of internet material , but all in vain. Maybe I am just too much into it that I am just overlooking a very simple solution.
Kindly advise.
Thanks
I would like to just point out for reference. The comment from Tim is the answer to this, for anyone looking for an answer. I cannot mark a comment as answer so just re writing it. Will mark it as answer until I find some better way to do it.
You'll have to open the file if you want to format it... – Tim Williams