Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bry Bry is offline
external usenet poster
 
Posts: 14
Default XL VB noobie needs help - macro opening file already in use prompt

Hi I have a macro that i have recorded that opens another file, makes some
changes and saves the file.

problem i have is the file is stored on a shared drive and can be used by
others, if the macro is run when someone else has the file open i would like
it to stop and state that the file is in use (if possible stating who is
already using but this isnt very important).

i have listed the code below, my apologies for asking daft questions but i
have very limited understanding of VB.

:-

Sub transfer1()
'
' transfer1 Macro
' Macro recorded 07/08/2006 by Bry
'

'
Sheets("Do not touch").Visible = True
Sheets("Do not touch2").Visible = True
Sheets("Do not touch").Select
Range("F15:F16").Select
Range("F16").Activate
Sheets("Query Logger").Select
ChDir "S:\bry\QRYLOGMK2"
Workbooks.Open Filename:="S:\bry\QRYLOGMK2\QRYLOGMK2.xls"
ActiveWindow.LargeScroll ToRight:=-8
Range("A2").Select
Selection.Copy
Windows("INPUT FORM.xls").Activate
Sheets("Do not touch").Select
Range("A7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("QRYLOGMK2.xls").Activate
Range("A2:BR2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("B2:BR2").Select
Range("BR2").Activate
Selection.Interior.ColorIndex = 2
Range("BR3").Select
Selection.Copy
Range("BR2").Select
ActiveSheet.Paste
Range("BQ2").Select
Windows("INPUT FORM.xls").Activate
Range("A13:BQ13").Select
Application.CutCopyMode = False
Selection.Copy
Windows("QRYLOGMK2.xls").Activate
Range("A2:BQ2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Notes").Select
Rows("1:1").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Sheets("Sheet1").Select
Range("A2").Select
Selection.Copy
Sheets("Notes").Select
Range("A1").Select
ActiveSheet.Paste
Selection.Interior.ColorIndex = 2
Sheets("Sheet1").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
Sheets("Do not touch2").Select
End Sub

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
Prompt message when opening a file Pernod Excel Worksheet Functions 1 October 13th 06 09:08 PM
Prompt Message when opening a file Pernod Excel Worksheet Functions 0 October 13th 06 08:09 PM
Dialog prompt during opening of file markuss New Users to Excel 1 June 21st 06 11:32 AM
Prompt for file name in a macro Louisville Cardinals Excel Discussion (Misc queries) 11 April 19th 05 02:39 PM
Autofilter macro for noobie mnvkngs Excel Programming 3 February 16th 05 04:29 PM


All times are GMT +1. The time now is 12:43 PM.

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"