I am trying to run a macro in a shared workbook but the macro fails. If the workbook is "un -shared" then there are no issues at all.
The macro fails I think because I used the ActiveSheet. syntax and probably excel cannot determine which one is the active sheet as multiple instances are open at any given time.
I get run time error '1004' saying the" this command is not allowed on a shared workbook" etc.
Any idea how to get around this?
I am just trying to import some data in the workbook sheet with that macro and this operation has to be done while excel is in shared mode.
Any help would be greatly appreciated
' Import_Data_friday Macro
' Macro recorded 25/09/2011 by Admin
With ActiveSheet.QueryTables.Add(Connection:= _
.Name = "Monday"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1)
sCell = ActiveCell.Value
Startcell = ActiveCell.Address
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
Loop Until IsEmpty(ActiveCell.Offset(0, 1))