Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel FileExists macro problem....

Guys/Gals,
Bit of backgroup to help out:
I am a ZENworks administrator for my company and we have 9 differen
sites. On each site I ran a ZEN application that reported whether o
not it ran on user's machines. If the application ran then the use
doesnt have Windows XP SP1 installed.

Problem:
I have created a single workbook that will import all the log file
from each site and compile them into 9 different tabs in an exce
workbook. The macro will successfully run however I am trying to expan
the macro to include error checking and more touchy fealy funtions.

When I run the macro it asks for the file name which I place into
variable called "Report". Currently the macro will then run the belo
command to connect to the log file on "sitea" and import this file.

With ActiveSheet.QueryTables.Add(Connection:="TEXT;\\Se rver UNC path\
& Report, Destination:=Sheets("sitea")

As I currently stand what I wanted to do was something like th
following:

If fs.FileExists("\\Server UNC path" & Report) = True Then

After the then I want to run the above Activesheet.Query macro, if th
if statement is false then I want it to write "File Does Not Exist
into Cell A1 on, in this case the Site1 worksheet

I am currently a bit stumped with this as I cant get the fileexis
funtion to work.

Is anyone able to help me with this or tell me where I am going wrong?

Regards,
Pau

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel FileExists macro problem....

Thanks for that, however I did find it before and being a n00
programmer, as in this is my 1st attempt doing macro's I wasnt sure ho
to integrate that function into my macro and where / how to put in al
the information in my macro to call the function as well as how t
configure the function to search for the file I want.

Pau

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel FileExists macro problem....

OK got it all working now thanks for all your help, calling a functio
for formatting the 9 sheets and the function for fileexists so agai
thanks!

One other thing I would like to know, how can I now attach my complete
macro to a command button on my intro sheet?

Regards,
Pau

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel FileExists macro problem....

Er again, dont worry figured it out myself :)

All sorted now, macro runs from a button on the excel sheet.

Job done :)

Thanks guys!

Pau

--
Message posted from http://www.ExcelForum.com

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
Excel-Macro Problem SR Excel Discussion (Misc queries) 8 July 20th 07 06:32 AM
FileExists Example: El Bee Excel Worksheet Functions 0 February 15th 06 09:19 PM
problem with macro on Excel Captain Picard Excel Worksheet Functions 0 February 1st 06 09:20 PM
Excel Macro Problem!? hbp78 Excel Programming 4 June 17th 04 08:04 PM
Excel XP macro problem Paul Reeve Excel Programming 1 November 10th 03 11:26 PM


All times are GMT +1. The time now is 09:10 AM.

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"