Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
TDW TDW is offline
external usenet poster
 
Posts: 18
Default This'll stump you! Problem with Copy Sheet between Excel versions

I wrote a simple macro (code listed below) to individually copy a subset of
sheets from a workbook to create new workbooks. The orginal workbook has 13
worksheets and the user wants to copy out 8 worksheets to separate workbooks
to distribute to others.

I test it on my machine running Excel 2003 SP1 and everything works fine. I
test it on another machine running Excel 2000 SP3 and everything works fine.
My wife tests it at work running Excel 2000 and everything works fine. A
colleague runs it on his machine and everything works fine. My client,
running Excel 2002 SP3, runs the macro and it fails. She can't even manually
copy a sheet in the workbook I've sent her! She works in any other workbook
and she can manually copy a sheet.

The VBA command I use to copy a worksheet to a new workbook, the line on
which the macro fails, is simply "Sheets(shtName).Copy". The error is
"Path/File access error (Error 75)."

So, I'm thinking there's some issue between versions. I save my workbook in
Excel 2003 using "Microsft Excel 97- Excel 2003 & 5.0/95 Workbook" file type.
Open it on the machine running 2000-SP3 and do a Save As using "Microsoft
Excel Workbook" thinking that it'll now be saved as a 2000 workbook. Send it
to the client and IT WORKS! ... But Wait ... there are changes ...

I make the changes, go through the same silly Save As process listed above,
send it back to the client and ... IT DOESN'T WORK!! What's with that? This
is just plain rude!

If you've read this far, I Thank You for sticking with me. If you have any
suggestions as to what the issue may be or how I might solve the problem I
would be sincerely grateful!

Thanks in advance for any help that may be provided!
tdw


Private Sub CreateWorkbook(shtName As String, flName As String, asAtDt As
String)

Application.StatusBar = "Creating the " + flName + " workbook"
Sheets(shtName).Copy
'the following formatting replaces existing formulae with values so that
the
'user is not continually prompted to update the formulae when they open
'the workbook
ActiveSheet.Range("H1").Value = "'" + asAtDt
Cells.Find(What:="Plus Already Approved This Fiscal Year",
LookIn:=xlFormulas, LookAt:=xlPart, MatchCase:=False).Cells(1, 2).Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Cells.Find(What:="Target For This Fiscal Year (High End of Range)",
LookIn:=xlFormulas, LookAt:=xlPart, MatchCase:=False).Cells(1, 2).Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A1").Activate

With ActiveWorkbook
.KeepChangeHistory = True
.SaveAs Filename:=flName, AccessMode:=xlShared
.Close
End With

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default This'll stump you! Problem with Copy Sheet between Excel versions

I would try not sharing the workbook. Based on your scenario, I don't see
any reason it would need to be shared.

With ActiveWorkbook
.KeepChangeHistory = True
.SaveAs Filename:=flName, AccessMode:=xlShared
.Close
End With


would need to be changed to not share the workbook

--
Regards,
Tom Ogilvy




"tdw" wrote in message
...
I wrote a simple macro (code listed below) to individually copy a subset

of
sheets from a workbook to create new workbooks. The orginal workbook has

13
worksheets and the user wants to copy out 8 worksheets to separate

workbooks
to distribute to others.

I test it on my machine running Excel 2003 SP1 and everything works fine.

I
test it on another machine running Excel 2000 SP3 and everything works

fine.
My wife tests it at work running Excel 2000 and everything works fine. A
colleague runs it on his machine and everything works fine. My client,
running Excel 2002 SP3, runs the macro and it fails. She can't even

manually
copy a sheet in the workbook I've sent her! She works in any other

workbook
and she can manually copy a sheet.

The VBA command I use to copy a worksheet to a new workbook, the line on
which the macro fails, is simply "Sheets(shtName).Copy". The error is
"Path/File access error (Error 75)."

So, I'm thinking there's some issue between versions. I save my workbook

in
Excel 2003 using "Microsft Excel 97- Excel 2003 & 5.0/95 Workbook" file

type.
Open it on the machine running 2000-SP3 and do a Save As using "Microsoft
Excel Workbook" thinking that it'll now be saved as a 2000 workbook. Send

it
to the client and IT WORKS! ... But Wait ... there are changes ...

I make the changes, go through the same silly Save As process listed

above,
send it back to the client and ... IT DOESN'T WORK!! What's with that?

This
is just plain rude!

If you've read this far, I Thank You for sticking with me. If you have any
suggestions as to what the issue may be or how I might solve the problem I
would be sincerely grateful!

Thanks in advance for any help that may be provided!
tdw


Private Sub CreateWorkbook(shtName As String, flName As String, asAtDt As
String)

Application.StatusBar = "Creating the " + flName + " workbook"
Sheets(shtName).Copy
'the following formatting replaces existing formulae with values so

that
the
'user is not continually prompted to update the formulae when they

open
'the workbook
ActiveSheet.Range("H1").Value = "'" + asAtDt
Cells.Find(What:="Plus Already Approved This Fiscal Year",
LookIn:=xlFormulas, LookAt:=xlPart, MatchCase:=False).Cells(1, 2).Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Cells.Find(What:="Target For This Fiscal Year (High End of Range)",
LookIn:=xlFormulas, LookAt:=xlPart, MatchCase:=False).Cells(1, 2).Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A1").Activate

With ActiveWorkbook
.KeepChangeHistory = True
.SaveAs Filename:=flName, AccessMode:=xlShared
.Close
End With

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default This'll stump you! Problem with Copy Sheet between Excel versions

This is speculation but you may be having problems because of the
AccessMode specification. It might be hard to debug remotely but does
the client have problems with the 2nd (or subsequent) attempt to create
the file? If so, it increases the likelihood of the AccessMode causing
the problem.

Can you ensure that the file is always under exclusive control before
you try and overwrite it? Or, as a test, can you create a new file
name each time? Does the problem still occur?

If the file is on a network drive there might be additional
security/sharing issues introduced into the analysis by the network
management software.

Finally, you may want to search support.microsoft.com for your error:
http://support.microsoft.com/search/...t.aspx?query=%
22file+access+error%22

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I wrote a simple macro (code listed below) to individually copy a subset of
sheets from a workbook to create new workbooks. The orginal workbook has 13
worksheets and the user wants to copy out 8 worksheets to separate workbooks
to distribute to others.

I test it on my machine running Excel 2003 SP1 and everything works fine. I
test it on another machine running Excel 2000 SP3 and everything works fine.
My wife tests it at work running Excel 2000 and everything works fine. A
colleague runs it on his machine and everything works fine. My client,
running Excel 2002 SP3, runs the macro and it fails. She can't even manually
copy a sheet in the workbook I've sent her! She works in any other workbook
and she can manually copy a sheet.

The VBA command I use to copy a worksheet to a new workbook, the line on
which the macro fails, is simply "Sheets(shtName).Copy". The error is
"Path/File access error (Error 75)."

So, I'm thinking there's some issue between versions. I save my workbook in
Excel 2003 using "Microsft Excel 97- Excel 2003 & 5.0/95 Workbook" file type.
Open it on the machine running 2000-SP3 and do a Save As using "Microsoft
Excel Workbook" thinking that it'll now be saved as a 2000 workbook. Send it
to the client and IT WORKS! ... But Wait ... there are changes ...

I make the changes, go through the same silly Save As process listed above,
send it back to the client and ... IT DOESN'T WORK!! What's with that? This
is just plain rude!

If you've read this far, I Thank You for sticking with me. If you have any
suggestions as to what the issue may be or how I might solve the problem I
would be sincerely grateful!

Thanks in advance for any help that may be provided!
tdw


Private Sub CreateWorkbook(shtName As String, flName As String, asAtDt As
String)

Application.StatusBar = "Creating the " + flName + " workbook"
Sheets(shtName).Copy
'the following formatting replaces existing formulae with values so that
the
'user is not continually prompted to update the formulae when they open
'the workbook
ActiveSheet.Range("H1").Value = "'" + asAtDt
Cells.Find(What:="Plus Already Approved This Fiscal Year",
LookIn:=xlFormulas, LookAt:=xlPart, MatchCase:=False).Cells(1, 2).Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Cells.Find(What:="Target For This Fiscal Year (High End of Range)",
LookIn:=xlFormulas, LookAt:=xlPart, MatchCase:=False).Cells(1, 2).Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A1").Activate

With ActiveWorkbook
.KeepChangeHistory = True
.SaveAs Filename:=flName, AccessMode:=xlShared
.Close
End With

End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
TDW TDW is offline
external usenet poster
 
Posts: 18
Default This'll stump you! Problem with Copy Sheet between Excel versions

Tom & Tushar, Thank You for your contributions!

Unfortunately, the problem has nothing to do with the workbook that is
created being shared. First, the macro bombs before getting to the command
that specifies the access mode. Second, the access mode on the newly created
workbook has to be shared in order to track changes. Third, the macro is only
accessible by one individual that has the 'master' workbook, the one with all
the worksheets, sitting on her computer.

The idea is that the macro will copy a subset of the sheets from the master
workbook, creating individual workbooks for each sheet in the subset. The
problem is that it bombs 'intermittently' on the first copy sheet command.

After much hair-pulling and head-scratching we were able to determine that
the user running the macro has restricted rights that caused the error. In
all cases and versions of Excel where it worked for me I was running it in an
environment that was either stand-alone or unrestricted access to network
resources. We were able to solve the problem on the client's computer by
ensuring the workbook was being saved and opened from their local hard drive
(not a network folder) and that the Tools Options General Default file
location also pointed to a folder on the local hard drive.

Again, Thank You for your input! If you would like more details please feel
free to e-mail me.

Sincerely,
tdw

  #5   Report Post  
Posted to microsoft.public.excel.programming
TDW TDW is offline
external usenet poster
 
Posts: 18
Default This'll stump you! Problem with Copy Sheet between Excel versions

Sorry, my signature wasn't appended to the previous post ...

Timothy White
Contract Programmer
Ontario, Canada

<my initialshite<atsympatico<dot<countryCode

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
Save multiple versions of a document/excel sheet Tonny Excel Discussion (Misc queries) 1 March 29th 09 04:30 PM
This'll be one for the wizards mr tom Excel Worksheet Functions 7 May 2nd 07 02:39 PM
Did I stump everyone? Counter that ignores hidden rows TechMGR Excel Discussion (Misc queries) 2 April 5th 05 08:45 PM
diferrent Excel versions connection problem da20 Excel Programming 0 March 30th 05 04:54 PM
Copy Sheet Problem Jim[_34_] Excel Programming 8 January 2nd 04 11:50 AM


All times are GMT +1. The time now is 08:42 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"