Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Excel file open in memory?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cottage6 - 17 Jan 2008 22:14 GMT
Hi all,
I have a spreadsheet and a .csv file that do things via a button in a Lotus
Notes database.  The .csv file extracts itself to the hard drive, and is then
imported into the Excel spreadsheet using a Workbook_Open macro. I think I
have a problem with a file or Excel  staying open in memory, or will have
very shortly. I just started getting an error saying the .csv file could not
be found by the Workbook_Open macro.  The file was not being extracted, but
extracting it under another name worked just fine.  I've posted the code
below that exports the range and saves it as a .csv file.  Code looks pretty
primitive next to the other examples I've seen here, but anyway.... I was
wondering if I need to do something else at the end of this?  Any help would
be greatly appreciated; I'm in over my head as usual!
Sub Export()
Application.DisplayAlerts = False
Application.Goto Reference:="EXPORTRANGE"
   Selection.Copy
   Workbooks.Add
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
       False, Transpose:=False
   Application.CutCopyMode = False
   Range("E1").Select
   Selection.NumberFormat = "mm/dd/yyyy"
   ChDir "C:\Lotus\work\123"
   Range("B:B,D:D,F:F,H:H,J:J,L:L,N:N,P:P,R:R,T:T,V:V,X:X,Z:Z").Select
   Range("B1").Activate
   Selection.Delete Shift:=xlToLeft
   ActiveWorkbook.SaveAs Filename:="C:\Lotus\work\123\bake.csv", _
       FileFormat:=xlCSV, CreateBackup:=False
   ActiveWorkbook.Close
Application.Quit
End Sub
Jim Cone - 19 Jan 2008 13:51 GMT
Each file name in a Windows folder must be unique.

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"cottage6"
wrote in message
Hi all,
I have a spreadsheet and a .csv file that do things via a button in a Lotus
Notes database.  The .csv file extracts itself to the hard drive, and is then
imported into the Excel spreadsheet using a Workbook_Open macro. I think I
have a problem with a file or Excel  staying open in memory, or will have
very shortly. I just started getting an error saying the .csv file could not
be found by the Workbook_Open macro.  The file was not being extracted, but
extracting it under another name worked just fine.  I've posted the code
below that exports the range and saves it as a .csv file.  Code looks pretty
primitive next to the other examples I've seen here, but anyway.... I was
wondering if I need to do something else at the end of this?  Any help would
be greatly appreciated; I'm in over my head as usual!
Sub Export()
Application.DisplayAlerts = False
Application.Goto Reference:="EXPORTRANGE"
   Selection.Copy
   Workbooks.Add
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
       False, Transpose:=False
   Application.CutCopyMode = False
   Range("E1").Select
   Selection.NumberFormat = "mm/dd/yyyy"
   ChDir "C:\Lotus\work\123"
   Range("B:B,D:D,F:F,H:H,J:J,L:L,N:N,P:P,R:R,T:T,V:V,X:X,Z:Z").Select
   Range("B1").Activate
   Selection.Delete Shift:=xlToLeft
   ActiveWorkbook.SaveAs Filename:="C:\Lotus\work\123\bake.csv", _
       FileFormat:=xlCSV, CreateBackup:=False
   ActiveWorkbook.Close
Application.Quit
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.