Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Receive Error File Not Found

I have created the below listed Macro. My goal is to OPEN a workbook named
GraphSendCom.xls and run the below listed Macro to pull another excel file
named "sendcom" into GraphSendcom.xls. This new workbook book has been set
up to pull the daily data into a graph and some overview answers in a more
narrow view. When it runs I can see the "sendcom" report where I want it
then a POP UP comes up and states file not found??? When I hit cancel it
seperates all the columns and does not allow me to use the data how I desire
it.

CAN YOU HELP ME SOLVE MY PROBLEM.




Sub main()

Dim destCell As Range


With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )
.UsedRange.Clear
Set destCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\EOD @ Web
Reports\@ Web SendCom\sendcom.xls", _
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(30, 1), Array(41, 1), Array(67, 1), Array(78, 1))

Set GraphSendCom = ActiveWorkbook

ActiveSheet.UsedRange.Copy _
Destination:=destCell

GraphSendCom.Close savechanges:=False

Application.Goto destCell, Scroll:=True

ActiveSheet.UsedRange.Columns.AutoFit
Close
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Receive Error File Not Found

You need to open the workbook before using it with the full pathname. After
the file is open you can reference the workbook with just the filename (no
path)

from:
Dim destCell As Range
With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )

to
Dim destCell As Range
Workbooks.open filename:="c:\temp\GraphSendCom.xls"

With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )

"Krefty" wrote:

I have created the below listed Macro. My goal is to OPEN a workbook named
GraphSendCom.xls and run the below listed Macro to pull another excel file
named "sendcom" into GraphSendcom.xls. This new workbook book has been set
up to pull the daily data into a graph and some overview answers in a more
narrow view. When it runs I can see the "sendcom" report where I want it
then a POP UP comes up and states file not found??? When I hit cancel it
seperates all the columns and does not allow me to use the data how I desire
it.

CAN YOU HELP ME SOLVE MY PROBLEM.




Sub main()

Dim destCell As Range


With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )
.UsedRange.Clear
Set destCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\EOD @ Web
Reports\@ Web SendCom\sendcom.xls", _
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(30, 1), Array(41, 1), Array(67, 1), Array(78, 1))

Set GraphSendCom = ActiveWorkbook

ActiveSheet.UsedRange.Copy _
Destination:=destCell

GraphSendCom.Close savechanges:=False

Application.Goto destCell, Scroll:=True

ActiveSheet.UsedRange.Columns.AutoFit
Close
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
R/T error 53 - File Not Found JMay Excel Discussion (Misc queries) 4 October 22nd 08 02:56 PM
Installation Error: File Not Found I h8 sku112.cab New Users to Excel 2 September 25th 08 10:58 PM
Runtime Error '53' File Not Found? et10yl Excel Discussion (Misc queries) 0 November 27th 06 10:49 PM
How to change closed file name - Error: file not found PGM Excel Programming 5 April 18th 06 02:07 PM
File not found - error Piranha[_39_] Excel Programming 18 September 19th 05 02:18 AM


All times are GMT +1. The time now is 02:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"