Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default sharing violation while saving file after adding this macro

Running XP Pro, Office 2003 all with latest updates installed.

Attempting to write macro to export a module from current workbook, then
import to another workbook that is also open.

Got the following code from CPearson's site:

Dim FName as string
With Workbooks("Book2")
fName = .Path & "\code.txt"
.VBProject.VBComponents("Module1").Export.FName
End With

Workbooks("Book1").VBProject.VBComponents.Import FName

code executes just fine, exporting, then importing 'module1'

Attempts to save either workbook generates a 'Sharing violation' message.

I've tried 'Save As' to a new file name to my local drive, no luck.

Any help would be appreciated.

Thanks Mike

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
Microsoft Excel 2007, Sharing Violation when saving file Kevin Hendrawan[_2_] Excel Discussion (Misc queries) 1 February 19th 10 11:14 AM
sharing violation when saving an excel file Kuger Excel Discussion (Misc queries) 5 August 12th 09 11:03 PM
Sharing Violation when saving Edward Wang Excel Discussion (Misc queries) 1 December 5th 08 03:01 AM
File Sharing Violation Jay Excel Discussion (Misc queries) 2 April 11th 08 10:16 PM
How do I stop sharing violation errors in Excel 2003 - file NOT sh USAOz Excel Discussion (Misc queries) 1 September 28th 06 05:06 PM


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