VBA Error

juan4412

Board Regular
Joined
Oct 17, 2011
Messages
94
On my machine this code works:
Code:
.SaveAs Filename:="C:\Ricardo\mail\" & Format(Range("G3").Value) & ".xls"

But on anothers PC it highlights the word "Format" and says object or library not installed, but they have the same references installed as I do.

What is throwing this error?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Not sure why it's throwing an error, but try using this instead since you are not changing the text format of the G3 value.

.SaveAs FileName:="C:\Ricardo\mail\" & Range("G3").Text & ".xls"
 
Upvote 0
I'd prefer not to have to change it since it works fine on my machine --- plus it would be a great deal of code to change.

Is it possibly a reference or library that I haveinstalled on my machine that is not on his?
 
Upvote 0
On your colleague's PC, when you check references in the VBA editor under Tools > Options, do any of the ticked references have the prefix "MISSING"?
 
Upvote 0
Adobe Distiller is flagged as missing, but I didn't think that Adobe Distiller has anything to do with the feature that is throwing a debug error.
 
Upvote 0
Uncheck the missing reference and try to run the code again. You're correct that Format() is not from that library, but it is confusing Excel in the background.
 
Upvote 0
If you change the line of code to this, it will still work on your PC and may work on your colleague's:
Rich (BB code):
.SaveAs Filename:="C:\Ricardo\mail\" & VBA.Format(Range("G3").Value) & ".xls"
Give it a try and let us know?
 
Upvote 0
Well he is pulling the report off of a network drive that we both can access.

It works if I preface the statement with VBA.Date -- But again that is going to leave a LOT of code to change.

Is there another option that I have?
 
Upvote 0
You could use the Find\Replace All (Ctrl+H) feature to make the edits to your code en masse.

Find What: Format(
Replace with: VBA.Format(
Replace All
 
Last edited:
Upvote 0

Forum statistics

Threads
1,222,151
Messages
6,164,244
Members
451,882
Latest member
Bigtop

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