Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2019, 11:58 PM
BrianT BrianT is offline VBA Not working Windows 10 VBA Not working Office 2019
Novice
VBA Not working
 
Join Date: May 2019
Posts: 3
BrianT is on a distinguished road
Default

Hi P45CAL

The seems to be an error on the filename when saving, I get an error in yellow

ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\" & strUser & "\Desktop\Forecast\" & part1 & " " & part2 & " " & part3 & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close

I changed the file name to exclude " & part1 & " " & part2 & " " & part3 & ".xlsx", and just save to desktop inthe folder, and it worked fine



Any ideas why this is not working - saving filename as cell A2 & C2 & L2

Pecoflyer - unclear what I have not done when entering the thread ?

Regards

Brian
Reply With Quote
  #2  
Old 05-12-2019, 08:29 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline VBA Not working Windows 7 64bit VBA Not working Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Quote:
Originally Posted by BrianT View Post
Pecoflyer - unclear what I have not done when entering the thread ?

As I mentioned you did not wrap your code with code tags
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 05-13-2019, 02:41 PM
BrianT BrianT is offline VBA Not working Windows 10 VBA Not working Office 2019
Novice
VBA Not working
 
Join Date: May 2019
Posts: 3
BrianT is on a distinguished road
Default

Hi p45cal

Thank you - works perfectly. I did have an illegal characters in the filename

Incidentally, if I wanted to save as a PDF File, instead of workbook what do I have t amend the format to

FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

Regards

Brian
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tasks Switch to Non-Working Days on Working Calendar danelloc Project 3 10-02-2017 12:38 PM
VBA Not working TOC Not Working Gary91 Word 3 01-21-2015 05:52 AM
VBA Not working working 4 10's, need help to set up rkirkland Project 1 12-19-2012 02:47 PM
GIF's stop working Kwarior PowerPoint 3 03-17-2010 09:59 PM
Spellchecker not working GR8Fandini Word 6 02-07-2010 01:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft