Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cannot view the menu or toolbar in Excel | Excel Discussion (Misc queries) | |||
Excel worksheet Menu Toolbar | Excel Worksheet Functions | |||
How to deploy custome toolbar/Menu commands in Excel? | Excel Worksheet Functions | |||
Setting Excel toolbar or menu icon in C# WITHOUT using builtin icons | Excel Programming | |||
Adding toolbar/menu command to Excel using C# | Excel Programming |