![]() |
Excel menu toolbar hyperlink issues
So I have an hyperlink to an excel file in the tool bar and I created
and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
Excel menu toolbar hyperlink issues
Auto_open macros don't run when you open a workbook through code.
You need to put you auto_open code in the workbook_open event which will run. -- Regards, Tom Ogilvy "Cliff" wrote in message om... So I have an hyperlink to an excel file in the tool bar and I created and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
Excel menu toolbar hyperlink issues
Hmm no dice.
doesnt seem to run at all now. If it help heres what I'm doing: ----snip----- Sub Workbook_Open() Application.ScreenUpdating = False ChDir "G:\Data Center Information\CSV" Workbooks.Open Filename:="G:\somefolderonafixeddisk\CSV\NewVehTmp .CSV", ReadOnly:=True, Editable:=False Rows("1:1").Select Selection.AutoFilter Cells.EntireColumn.AutoFit Range("A1").Select ActiveCell.FormulaR1C1 = "MSCode" Range("B1").Select ActiveCell.FormulaR1C1 = "Year" Range("C1").Select ActiveCell.FormulaR1C1 = "Make" Range("D1").Select ActiveCell.FormulaR1C1 = "Model" Range("E1").Select ActiveCell.FormulaR1C1 = "Description" Range("F1").Select ActiveCell.FormulaR1C1 = "MSRP" Rows("1:1").Select With Selection.Interior .ColorIndex = 48 .Pattern = xlSolid .Interior.ColorIndex = 15 .Font.Bold = True End With Columns("B:B").Select Selection.AutoFilter Field:=2, Criteria1:="2003" Selection.Font.ColorIndex = 12 Selection.AutoFilter Field:=2, Criteria1:="2003.5" Selection.Font.ColorIndex = 12 Selection.AutoFilter Field:=2, Criteria1:="2004" Selection.Font.ColorIndex = 9 Selection.AutoFilter Field:=2, Criteria1:="2004.5" Selection.Font.ColorIndex = 9 Selection.AutoFilter Field:=2, Criteria1:="2005" Selection.Font.ColorIndex = 5 ActiveSheet.ShowAllData Columns("A:F").Select Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Range("A1").Select Application.ScreenUpdating = True End Sub ----snip----- "Tom Ogilvy" wrote in message ... Auto_open macros don't run when you open a workbook through code. You need to put you auto_open code in the workbook_open event which will run. -- Regards, Tom Ogilvy "Cliff" wrote in message om... So I have an hyperlink to an excel file in the tool bar and I created and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
Excel menu toolbar hyperlink issues
Sorry for my ignorance in this matter. I apparently dont even know
what to search for... So this is an "application level event"? I would have to make it public? How does anyone read these Oriely books... arg. "Tom Ogilvy" wrote in message ... Auto_open macros don't run when you open a workbook through code. You need to put you auto_open code in the workbook_open event which will run. -- Regards, Tom Ogilvy "Cliff" wrote in message om... So I have an hyperlink to an excel file in the tool bar and I created and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
Excel menu toolbar hyperlink issues
Ahhh.. I see!!! thanks!
"Tom Ogilvy" wrote in message ... Auto_open macros don't run when you open a workbook through code. You need to put you auto_open code in the workbook_open event which will run. -- Regards, Tom Ogilvy "Cliff" wrote in message om... So I have an hyperlink to an excel file in the tool bar and I created and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
Excel menu toolbar hyperlink issues
okay.. i lied. Still doesnt work.
Its setup as a workbook open event and it doesnt run when opend by code. "Tom Ogilvy" wrote in message ... Auto_open macros don't run when you open a workbook through code. You need to put you auto_open code in the workbook_open event which will run. -- Regards, Tom Ogilvy "Cliff" wrote in message om... So I have an hyperlink to an excel file in the tool bar and I created and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
Excel menu toolbar hyperlink issues
the workbook_open event has to be in the Thisworkbook module.
You get to this by going to the project explorer, in the vbe, find you project and double click on thisworkbook entry under you project. In the left dropdown at the top of the module, select Workbook, from the right dropdown, select Open. this will put in a procedure declaration like Private Sub Workbook_Open() End Sub put any code you want to run either in between those lines or call an existing procedure from there. this is not an application level event - it is a workbook level event. you can also look at Chip Pearson's page on events http://www.cpearson.com/excel/event.htm -- Regards, Tom Ogilvy "Cliff" wrote in message om... okay.. i lied. Still doesnt work. Its setup as a workbook open event and it doesnt run when opend by code. "Tom Ogilvy" wrote in message ... Auto_open macros don't run when you open a workbook through code. You need to put you auto_open code in the workbook_open event which will run. -- Regards, Tom Ogilvy "Cliff" wrote in message om... So I have an hyperlink to an excel file in the tool bar and I created and auto_open macro to read a temporary csv I need retreive and format data from. When I go to the directory and open the excel it work flawlessly but when I run it as a menubar hyperlink to a file it doesnt run the macro. Its Excel 2000. and the Excel file I'm opening hides iteslf and then opens and formats the temporary CSV file for display. any thoughts on why it opens diffrently each way and how I can work around this? thanks, -Cliff |
All times are GMT +1. The time now is 12:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com