Ask Software Development Questions and Get Answers ASAp
Hello,I am Pete, and I'll be happy to assist with your question today.
You can use the following code to convert the file format from .xls to .xlsx:
Set Workbook = Excel.Workbooks.Open("\DailyOpsAuditingList.xls")
Set Worksheet = Workbook.Worksheets(1)
Workbook.SaveAs "\DailyOpsAuditingList.xlsb", xlExcel12
.xlsb is a binary file format (the B stands for Binary). The binary file size is generally smaller than a .xlsx file and therefore opens and saves much faster than an .xlsx file. You can use .xlsx if you prefer.
What error are you getting when you use the code?
Hi there, my name is***** can help you get this done. Hold on a few minutes and I'll send you back the right code to use.
Ok, here's what you need to do:
The macro assumes there is only one attachment. You had a loop in your version above, but it wasn't making any kind of distinction in the loop, so I changed it to take the first attachment. It checks to make sure it has an xls extension or it won't run.
The macro saves the file with its new name and location, but its old format. Then it opens Excel, opens the workbook and saves it under the current format. Then it deletes the original file (xls) that it saved from Outlook.
Please let me know if you have any questions or problems.
If I've answered your question and resolved your issue, can you please accept the answer and rate me 5 stars? I don't get paid anything for helping you unless you accept the answer If not, please chat me back and I'll get you the information you need to resolve your issue. Thanks and have a great day!
Pete opted out, which means he quit because he didn't know how to solve your issue, so I picked up the question because I can help you.
The version of the Excel object library really shouldn't matter. I know it works because I tested it here, so we just need to figure out what's different between our setups.
Can you give this a try: Open an email with an attachment and run the script with the attachment open. If it still doesn't do anything, open the VB editor, click on the first line of the macro and press F8. You'll see a yellow bar start to go step-by-step through the program each time you press F8. Then we can see what's going on. If I'm online when you check, chat me up and maybe we can look at it together.
hey are you there?
Yeah, that should be ok
hey there, sorry i got tied up with someone else...
Hey there, I'm sorry I was helping other people and am just now able to get back to this. Can you give me a time that you'll be available on Monday and we can both be on at the same time?