![]() |
Help with VBA programing
Hey ppl...I have a question and I was wondering if anyone could help.
designed a excel sheet and I want to download info off the net to th work sheet specifically the 3 bond graphs at the top of this pag http://money.cnn.com/markets/bondcenter/ Is this possible? Also I would like to put something like a demo time limit on it, i this possible? The company I work for has asked me to turn my workboo over to this new company that we've merged with. I don't know a whol lot about this company and I don't want them to be able to keep all m hard work if I decide that the new company is not worth working for. I anyone could help i would appreciate it. CyberStorm @ Tampabay.rr. co -- Message posted from http://www.ExcelForum.com |
Help with VBA programing
CyberStorm,
Here is a VBA code snip that will put the images from the web into you sheet. Note that instead of using the main web page that yo specified, I right-clicked on each of the graphs and got the URL of th individual gif file. This page looks like it has images whose name probably don't change over time so this solution should work. If b some chance the CNN people (actually bigcharts.com) change the addres of the gif files you will have to re-think this solution. '*** Begin code Dim MyURL Range("A1").Select MyURL "http://chart.bigcharts.com/custom/cnnmoney-com/markets/cnnmoney-5year-price.gifquote" ActiveSheet.Pictures.Insert MyURL Range("D1").Select MyURL "http://chart.bigcharts.com/custom/cnnmoney-com/markets/cnnmoney-10year-yield.gifquote" ActiveSheet.Pictures.Insert MyURL Range("G1").Select MyURL "http://chart.bigcharts.com/custom/cnnmoney-com/markets/cnnmoney-10year-price.gifquote" ActiveSheet.Pictures.Insert MyURL '*** End code BTW... these images are copyrighted. Cheers. mjclar -- Message posted from http://www.ExcelForum.com |
Help with VBA programing
Thanks for the response. On the second question: I found the answer.
found that excel is not very secure and anyone with an average offic password cracker and knows a little about VBE can easily change you settings but here's the code that I used if anyone is interested. I Forces Macros, Hides the tool bars, and deletes the page after a give time. If theres any problems please email me. 'Actual code to paste 'Includes forcing macros '(To force macros 'in your workbook 'create a sheet on which you write a message 'such as "you must enable the macros if you want 'to use this workbook. Please close this 'workbook and reopen it enabling the macros"). 'Hiding tool bars, and 'Putting a time limit on the workbook 'Make sure you change the date in "Sub Workbook_Activate" to whateve date you want it to delete. 'Place first section in "ThisWorkbook" code Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ScreenUpdating = False Sheets(1).Visible = True For i = Sheets.Count To 2 Step -1 Sheets(i).Visible = xlVeryHidden Next i ShowToolbars True End Sub Private Sub Workbook_Open() Application.ScreenUpdating = False For Each sh In Sheets sh.Visible = True Next sh Sheets(1).Visible = xlVeryHidden ShowToolbars False End Sub Private Sub Workbook_Activate() If Date = #7/25/2005# Then ThisWorkbook.Saved = True MsgBox "This file has expired, it will be deleted!" ThisWorkbook.ChangeFileAccess xlReadOnly Kill ThisWorkbook.FullName End If End Sub ++++++++++++++++++++++++ 'Paste this in module 1 code Sub ShowToolbars(ToBeSeen As Boolean) Dim CB As CommandBar For Each CB In Application.CommandBars If Not CB.Name = CommandBars.ActiveMenuBar.Name Then CB.Enabled ToBeSeen Next End Su -- Message posted from http://www.ExcelForum.com |
Help with VBA programing
Thanks for the response. On the second question: I found the answer.
found that excel is not very secure and anyone with an average offic password cracker and knows a little about VBa can easily change you settings but here's the code that I used if anyone is interested. I Forces Macros, Hides the tool bars, and deletes the page after a give time. If theres any problems please email me. 'Actual code to paste 'Includes forcing macros '(To force macros 'in your workbook 'create a sheet on which you write a message 'such as "you must enable the macros if you want 'to use this workbook. Please close this 'workbook and reopen it enabling the macros"). 'Hiding tool bars, and 'Putting a time limit on the workbook 'Make sure you change the date in "Sub Workbook_Activate" to whateve date you want it to delete. 'Place first section in "ThisWorkbook" code Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ScreenUpdating = False Sheets(1).Visible = True For i = Sheets.Count To 2 Step -1 Sheets(i).Visible = xlVeryHidden Next i ShowToolbars True End Sub Private Sub Workbook_Open() Application.ScreenUpdating = False For Each sh In Sheets sh.Visible = True Next sh Sheets(1).Visible = xlVeryHidden ShowToolbars False End Sub Private Sub Workbook_Activate() If Date = #7/25/2005# Then ThisWorkbook.Saved = True MsgBox "This file has expired, it will be deleted!" ThisWorkbook.ChangeFileAccess xlReadOnly Kill ThisWorkbook.FullName End If End Sub ++++++++++++++++++++++++ 'Paste this in module 1 code Sub ShowToolbars(ToBeSeen As Boolean) Dim CB As CommandBar For Each CB In Application.CommandBars If Not CB.Name = CommandBars.ActiveMenuBar.Name Then CB.Enabled ToBeSeen Next End Su -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 01:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com