workbooks as input to VBA tool not working properly

01's

Board Regular
Joined
Jun 1, 2011
Messages
85
Hi Guys,

I use 5 workbooks as inputs to a VBA tool. I receive these files zipped in mail from a team mate.When I unzip the files to a folder and use directly as input it throws error in line - "Workbooks.Open Filename:=<workbook name>". But when I open all 5 files and resave them in same ".xlsx" format and then use them as inputs; the tool works very fine.
Also I get error "excel found unreadable content...." when I open the workbooks for the first time after unzipping. Can anyone pls guide.
I am quite sure my codes are perfect.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
can you post your code?

hi,
I am posting partial code. Lats line in orange is where error throws.....

Sub Copy_IR_Resolved_files()

Dim datasheet As Worksheet
Dim wksheet As Worksheet
Dim ws_count As Integer

Do
IR_resolved = Application.GetOpenFilename(FileFilter:="Excel Files (*.xlsx), *.xlsx", Title:="Please select IR resolved file")
If (IR_resolved <> False) Then GoTo D
MsgBox ("Please select IR resolved file for correct tool run")
Loop While (IR_resolved = False)
D:
Workbooks.Open Filename:=IR_resolved
 
Upvote 0
Code:
If (IR_resolved <> [B][COLOR="Red"]"[/COLOR][/B]False[COLOR="red"][B]"[/B][/COLOR]) Then GoTo D
 
Upvote 0
I am quite sure my codes are perfect.
So it was working perfectly and then it suddenly stopped working, yes?

Had anything just changed immediately before that, like a new version of Office or something like that?
 
Upvote 0
So it was working perfectly and then it suddenly stopped working, yes?

Had anything just changed immediately before that, like a new version of Office or something like that?


As I said in my query above that it works fine now too but with little adjustment - I need to resave all files as ".xlsx"

This problem has been there since beginning.
 
Upvote 0
instead of just extracting the files from the zip folder you could just open them all then save them where you want them :D
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top