Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel opens two workbooks ChristyL Excel Discussion (Misc queries) 3 September 25th 08 04:25 PM
Excel opens 2 blank workbooks at start-up. How to correct this? Baanwestwood Excel Discussion (Misc queries) 1 May 25th 07 02:59 PM
Excel workbooks opens in Outlook. Why? rozcats Excel Discussion (Misc queries) 1 April 9th 07 10:42 PM
Excel opens all workbooks within the same app window. rana Excel Discussion (Misc queries) 2 January 27th 06 09:20 AM
VLookUp when Macro Opens WorkBooks David Adamson[_4_] Excel Programming 0 August 26th 04 12:15 AM


All times are GMT +1. The time now is 08:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"