ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   running macros in downloaded files (https://www.excelbanter.com/excel-programming/285997-running-macros-downloaded-files.html)

blueshot[_3_]

running macros in downloaded files
 
Daily I have to access an .xls file that downloads from the internet
with a different filename each time.

I want to write a macro that will delete info that I don't need and
adjust formatting that I want for this file. I think I can come up
with the meat of the code but how do I get it to work on the downloaded
file each time I download it?

I would prefer that it didn't change the file instantaneously as I
would like to verify the file first. I would like a command button to
pop up to start the process. Am I wishing for too much? I am not a
very good programmer yet so please keep that in mind when proposing
suggestions.

Thank you all very much!


---
Message posted from http://www.ExcelForum.com/


blueshot[_4_]

running macros in downloaded files
 
Can nobody help with this?!?
:confused:


---
Message posted from http://www.ExcelForum.com/


Rob van Gelder[_4_]

running macros in downloaded files
 
You're talking about an Excel Workbook, with some macros, that at the push
of a button opens and formats another workbook.

From what I gather, you may already have the workbook open.

Here's something to work with:
Sub testit()
Dim wkbDest As Workbook

On Error GoTo e
Set wkbDest = Workbooks("Book2.xls")
On Error GoTo 0

With wkbDest.Worksheets(1)
.Rows(1).Interior.ColorIndex = 34
End With

Exit Sub

e: Workbooks.Open "C:\T\Book2.xls"
Resume
End Sub



"blueshot" wrote in message
...
Daily I have to access an .xls file that downloads from the internet
with a different filename each time.

I want to write a macro that will delete info that I don't need and
adjust formatting that I want for this file. I think I can come up
with the meat of the code but how do I get it to work on the downloaded
file each time I download it?

I would prefer that it didn't change the file instantaneously as I
would like to verify the file first. I would like a command button to
pop up to start the process. Am I wishing for too much? I am not a
very good programmer yet so please keep that in mind when proposing
suggestions.

Thank you all very much!


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 11:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com