Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookUp when Macro Opens WorkBooks
I think you are looking for this peice of code:
ThisWorkbook.UpdateRemoteReferences = False or depending if you wanted to choose yes, ThisWorkbook.UpdateRemoteReferences = True Without knowing more about your code I can't tell you exactly where to put it though... "JavyD" wrote: It's the popup message box that says this work book contains automatic links to information in another work book. Do you want to update this work book, bla bla bla, yes or no. That's the message that I have to click no on 400 times. "sebastienm" wrote: Hi JavyD, what VLook Up message ? is it a message displayed by your macro. I can't think of any vlook message from excel itself. Regadrs, Sébastien "JavyD" wrote: Hello guys, I have a macro at the moment, thanks to the help of Tom and Ron. What it does it opens up over 400 work books, changes a few cells, then saves them and closes them. Now each of these 400 work books, has hundreds of VLook Ups. How can I add to this macro more code that when the macro opens the report, that the VLook Up message doesnt pop up, and I have to sit there for an hour clicking no no no no, dont update? Regards, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookUp when Macro Opens WorkBooks
Jim, this is the code I have. I just bought a VBA book so that I can tag
alone with you guys. But if you can figure this last one out for me, I'll read up so that I dont have to ask so many questions. But I've come to realize, the more you know, the more you actually dont know. Sub Quote() Dim mybook As Workbook Dim FNames As String Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir MyPath = "C:\Documents and Settings\Javier\My Documents\Test\" ChDrive MyPath ChDir MyPath FNames = Dir("*.xls") If Len(FNames) = 0 Then MsgBox "No files in the Directory" ChDrive SaveDriveDir ChDir SaveDriveDir Exit Sub End If Application.ScreenUpdating = False Do While FNames < "" Set mybook = Workbooks.Open(FNames) mybook.Worksheets(1).Range("D17").Formula = "= C17*1.3352" mybook.Worksheets(1).Range("C25").Formula = "=(SUM(B25*F20)/F19)/1.3352" mybook.Close True FNames = Dir() Loop ChDrive SaveDriveDir ChDir SaveDriveDir Application.ScreenUpdating = True End Sub "Jim Thomlinson" wrote: I think you are looking for this peice of code: ThisWorkbook.UpdateRemoteReferences = False or depending if you wanted to choose yes, ThisWorkbook.UpdateRemoteReferences = True Without knowing more about your code I can't tell you exactly where to put it though... "JavyD" wrote: It's the popup message box that says this work book contains automatic links to information in another work book. Do you want to update this work book, bla bla bla, yes or no. That's the message that I have to click no on 400 times. "sebastienm" wrote: Hi JavyD, what VLook Up message ? is it a message displayed by your macro. I can't think of any vlook message from excel itself. Regadrs, Sébastien "JavyD" wrote: Hello guys, I have a macro at the moment, thanks to the help of Tom and Ron. What it does it opens up over 400 work books, changes a few cells, then saves them and closes them. Now each of these 400 work books, has hundreds of VLook Ups. How can I add to this macro more code that when the macro opens the report, that the VLook Up message doesnt pop up, and I have to sit there for an hour clicking no no no no, dont update? Regards, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookUp when Macro Opens WorkBooks
Jim's recommendation won't solve your problem. Even if it would suppress
the prompt (and I don't believe it will), it can't be set until the workbook is opened and the question prompt has already been displayed. Using the updatelinks argument in the workbook_open method will work and I previously posted an adjusted copy of your code. -- Regards, Tom Ogilvy "JavyD" wrote in message ... Jim, this is the code I have. I just bought a VBA book so that I can tag alone with you guys. But if you can figure this last one out for me, I'll read up so that I dont have to ask so many questions. But I've come to realize, the more you know, the more you actually dont know. Sub Quote() Dim mybook As Workbook Dim FNames As String Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir MyPath = "C:\Documents and Settings\Javier\My Documents\Test\" ChDrive MyPath ChDir MyPath FNames = Dir("*.xls") If Len(FNames) = 0 Then MsgBox "No files in the Directory" ChDrive SaveDriveDir ChDir SaveDriveDir Exit Sub End If Application.ScreenUpdating = False Do While FNames < "" Set mybook = Workbooks.Open(FNames) mybook.Worksheets(1).Range("D17").Formula = "= C17*1.3352" mybook.Worksheets(1).Range("C25").Formula = "=(SUM(B25*F20)/F19)/1.3352" mybook.Close True FNames = Dir() Loop ChDrive SaveDriveDir ChDir SaveDriveDir Application.ScreenUpdating = True End Sub "Jim Thomlinson" wrote: I think you are looking for this peice of code: ThisWorkbook.UpdateRemoteReferences = False or depending if you wanted to choose yes, ThisWorkbook.UpdateRemoteReferences = True Without knowing more about your code I can't tell you exactly where to put it though... "JavyD" wrote: It's the popup message box that says this work book contains automatic links to information in another work book. Do you want to update this work book, bla bla bla, yes or no. That's the message that I have to click no on 400 times. "sebastienm" wrote: Hi JavyD, what VLook Up message ? is it a message displayed by your macro. I can't think of any vlook message from excel itself. Regadrs, Sébastien "JavyD" wrote: Hello guys, I have a macro at the moment, thanks to the help of Tom and Ron. What it does it opens up over 400 work books, changes a few cells, then saves them and closes them. Now each of these 400 work books, has hundreds of VLook Ups. How can I add to this macro more code that when the macro opens the report, that the VLook Up message doesnt pop up, and I have to sit there for an hour clicking no no no no, dont update? Regards, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel opens two workbooks | Excel Discussion (Misc queries) | |||
Excel opens 2 blank workbooks at start-up. How to correct this? | Excel Discussion (Misc queries) | |||
Excel workbooks opens in Outlook. Why? | Excel Discussion (Misc queries) | |||
Excel opens all workbooks within the same app window. | Excel Discussion (Misc queries) | |||
VLookUp when Macro Opens WorkBooks | Excel Programming |